Skip to content

Commit d403ba9

Browse files
authored
file_name_in_send_file (#140)
Some times file name not set in request. It is better to set it explicitly.
1 parent fe29aab commit d403ba9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: flask_pymongo/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def get_upload(filename):
170170
mimetype=content_type,
171171
direct_passthrough=True,
172172
)
173+
response.headers['Content-Disposition'] = 'attachment; filename={}'.format(filename)
173174
response.content_length = fileobj.length
174175
response.last_modified = fileobj.upload_date
175176
# Compute the sha1 sum of the file for the etag.

0 commit comments

Comments
 (0)