Select non-image file in Django ckeditor browser

24 Views Asked by At

I previously uploaded a zip file from django_ckeditor, and I want to create a link to that file.
So I clicked the "link" button (or Ctrl-K), and then selected the "browse server" button to select my file.

However, when I select the file, I see no button to select the file, and the preview pane kept spinning: failed to load file

But when an image is selected, I'm able to select the "Embed image" button: enter image description here

Relative Django setting:

CKEDITOR_UPLOAD_PATH = "public/"
CKEDITOR_UPLOAD_SLUGIFY_FILENAME = False
CKEDITOR_RESTRICT_BY_USER = False
CKEDITOR_RESTRICT_BY_DATE = False
CKEDITOR_FILENAME_GENERATOR = 'util.func.ckupload_name'
CKEDITOR_CONFIGS = {
        'default': {
            'toolbar': 'full',
            }
        }
def ckupload_name(fname, request):
    return f'{uuid.uuid4()}/{fname}'

It looks like the image functionality, but I'm sure I'm opening this box using the "link" feature.
Because the files are uploaded to a random folder, I cannot manually enter the link easily. (I verified that if I found the UUID part, I can download the file from web)

If I right click the broken image icon and select "copy image url", I can get the link. But since that would be too difficult for other users in my organization, I'm looking for a more straight forward way to get the link.

0

There are 0 best solutions below