Skip to content

Commit

Permalink
refs #904. Sets content type for downloads.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Littman committed May 24, 2018
1 parent a5666bd commit d3795b4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sfm/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ def export_file(request, pk, file_name):
if os.path.exists(filepath):
response = StreamingHttpResponse()
response['Content-Disposition'] = 'attachment; filename=%s' % file_name
response['Content-Type'] = 'application/octet-stream'
file_obj = open(filepath)
response.streaming_content = _read_file_chunkwise(file_obj)
return response
Expand Down

0 comments on commit d3795b4

Please sign in to comment.