Ensure that JSON files should be downloaded properly from the storage manager. Fixes #7118

This commit is contained in:
Rahul Shirsat
2022-01-25 20:17:50 +05:30
committed by Akshay Joshi
parent 04729f63b8
commit deab1bfaba
3 changed files with 8 additions and 12 deletions

View File

@@ -1222,7 +1222,9 @@ class Filemanager(object):
else:
dir_path = os.path.dirname(path)
response = send_from_directory(dir_path, name, as_attachment=True)
response = send_from_directory(dir_path, name,
mimetype='application/octet-stream',
as_attachment=True)
response.headers["filename"] = name
return response