Skip to content

Instantly share code, notes, and snippets.

@blaflamme
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save blaflamme/18b9ab7769a436729d19 to your computer and use it in GitHub Desktop.

Select an option

Save blaflamme/18b9ab7769a436729d19 to your computer and use it in GitHub Desktop.
# file.path = '/a/apth/to/a/file'
# file.filename = 'something.jpg'
response = FileResponse(file.path)
response.content_disposition = 'attachment;filename="{}"'.format(file.filename)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment