fix in handling file name with special characters
authorMaciej Tronowski <mtro@man.poznan.pl>
Wed, 2 Sep 2015 13:18:45 +0000 (15:18 +0200)
committerDawid Jagieła <lightnir@gmail.com>
Sat, 12 Sep 2015 10:08:35 +0000 (12:08 +0200)
filex/views.py

index ada8b7b..3215fd8 100644 (file)
@@ -89,7 +89,7 @@ class DownloadView(FTPView):
         mime_type, encoding = mimetypes.guess_type(name)
 
         response = StreamingHttpResponse(data, content_type=mime_type or 'application/octet-stream')
-        response['Content-Disposition'] = u'attachment; filename={}'.format(name)
+        response['Content-Disposition'] = 'attachment; filename*={}'.format(urlquote(name))
         response['Content-Length'] = stats['size']
 
         if encoding: