Skip to content
Permalink
Browse files

Change send_file to open, rather than download, PDF files

  • Loading branch information
nicolazilio committed Jan 8, 2020
1 parent f005925 commit f12e21c572e37e8f311619da39994576430875ef
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/wiki/core/http.py
@@ -44,6 +44,9 @@ def send_file(request, filepath, last_modified=None, filename=None):

if filename:
filename_escaped = filepath_to_uri(filename)
response["Content-Disposition"] = "attachment; filename=%s" % filename_escaped
if 'pdf' in mimetype.lower():
response["Content-Disposition"] = "inline; filename=%s" % filename_escaped
else:
response["Content-Disposition"] = "attachment; filename=%s" % filename_escaped

return response

0 comments on commit f12e21c

Please sign in to comment.
You can’t perform that action at this time.