Commit 8d8dd420 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

to force 'download as attachment' should not be a part of index_html API, and...

to force 'download as attachment' should not be a part of index_html API, and we already have this logic in Base_download script.
parent 9168a288
......@@ -104,12 +104,6 @@ class DownloadableMixin:
RESPONSE.setHeader('Content-Type', '%s; charset=utf-8' % mime)
else:
RESPONSE.setHeader('Content-Type', mime)
if output_format not in (VALID_TEXT_FORMAT_LIST + VALID_IMAGE_FORMAT_LIST):
# need to return it as attachment
filename = self.getStandardFilename(format=format)
RESPONSE.setHeader('Content-Disposition',
'attachment; filename="%s"' % filename)
RESPONSE.setHeader('Accept-Ranges', 'bytes')
return str(data)
security.declareProtected(Permissions.AccessContentsInformation,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment