--- a/src/pyams_file/views/file.py Thu Feb 14 17:37:44 2019 +0100
+++ b/src/pyams_file/views/file.py Mon Feb 18 09:51:24 2019 +0100
@@ -12,17 +12,14 @@
__docformat__ = 'restructuredtext'
-
-# import standard library
from http.client import NOT_MODIFIED, PARTIAL_CONTENT
-# import interfaces
-from pyams_file.interfaces import IFile
+from pyramid.response import Response
+from pyramid.view import view_config
from zope.dublincore.interfaces import IZopeDublinCore
-# import packages
-from pyramid.response import Response
-from pyramid.view import view_config
+from pyams_file.interfaces import IFile
+from pyams_utils.unicode import translate_string
MAX_RANGE_LENGTH = 1 << 21 # 2 Mb
@@ -50,7 +47,8 @@
body_file = context.get_blob(mode='c')
if request.params.get('download') is not None:
- response.content_disposition = 'attachment; filename="{0}"'.format(context.filename)
+ response.content_disposition = 'attachment; filename="{0}"'.format(translate_string(context.filename,
+ force_lower=False))
# check for range request
if request.range is not None: