#15181: FileSystemStorage generates wrong URL when path contains special characters ----------------------------------+----------------------------------------- Reporter: e.generalov | Owner: nobody Status: new | Milestone: Component: File uploads/storage | Version: SVN Keywords: | Stage: Unreviewed Has_patch: 1 | ----------------------------------+----------------------------------------- I have a model with models.FileField and admin interface. When I upload any file that contains special characters in the name (for example `test#12.jpg`), then I can't to download it by link in the admin change form.
There is a bug in the FileSystemStorage URL generation algorithm. This doesn't escapes special characters. Therefore the '/media/test#12.jpg' URL is produced and browser treats #12.jpg as a fragment part. I notice same bug in the https://github.com/sorl/sorl- thumbnail/blob/legacy/sorl/thumbnail/main.py#L96 too, where iri_to_uri() is used for filepath-to-uri convertion (this method gives a wrong result too). Therefore I suggest to place such function in the django core (see the patch). -- Ticket URL: <http://code.djangoproject.com/ticket/15181> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.
