4👍
✅
from django.utils.encoding import smart_str
...
response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(filename)
3👍
You can fix the problem on the Django side but there is no guarantee it will work in all browsers.
See the testcases at http://greenbytes.de/tech/tc2231/.
For more details on this see this question, which links to a snippet to handle most cases.
- [Django]-Linux + Django + SQLServer
- [Django]-Force reload on client's webpage Django
- [Django]-Is there a Django template filter that turns a datetime into "5 hours ago" or "12 days ago"?
- [Django]-Recursive relationship in django doesn't work
Source:stackexchange.com