Commit 248b293d authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Use content-disposition header to set file name for Open/Download

parent 933529b4
......@@ -24,7 +24,7 @@
%if hasrclextract:
<div class="search-result-links">
<a href="/preview/{{number-1}}?{{query_string}}" target="_blank">Preview</a>
<a href="/edit/{{number-1}}?{{query_string}}">Open</a>
<a href="/edit/{{number-1}}?{{query_string}}">Download/Open</a>
</div>
%end
<div class="search-result-date">{{d['time']}}</div>
......
......@@ -294,6 +294,8 @@ def edit(resnum):
rclq.scroll(resnum)
doc = rclq.fetchone()
bottle.response.content_type = doc.mimetype
bottle.response.headers['Content-Disposition'] = \
'attachment; filename=%s' % doc.filename
# If ipath is null, we can just return the file
pathismine = False
if doc.ipath == '':
......
Supports Markdown
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