Skip to content

Uploaded files with ampersand in name can't be deleted or renamed #88

@mitnosirrag

Description

@mitnosirrag

Uploaded files with an ampersand (&) in their name fail to rename or delete.

To recreate for deletion:

  1. Upload an image with an ampersand (&) in the title
  2. Try to delete the image
  3. The image is reported as having been deleted, but remains in the system

To recreate for renaming (file is called "pantry_&_kitchen.jpeg"):

  1. Upload an image with an ampersand (&) in the title
  2. Click the icon to rename the image
  3. Apply a new name and slick "submit"
  4. The following error appears:

IOError at /admin/media-library/rename/
[Errno 2] No such file or directory: u'/home/ubuntu/media/uploads/products/pantry_'

I fixed the deletion issue locally, it appears that tagging file.filename with |urlencode does the trick. I applied it to lines 89 and 101 in templates/filebrowser/include/filelisting.html and am able to delete images.

I haven't figured out how the query_string tag works to fix the encoding there, but it seems like the fix would need to be applied there and maybe in templates/filebrowser/rename.html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions