Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. content_type, _ = mimetypes.guess_type(f.name)
  2.  
  3. response = FileResponse(f)
  4. if content_type:
  5.     response['content-type'] = content_type
  6. response['content-disposition'] = 'attachment; filename="{}"'.format(receipt.name)
  7.  
  8. return response
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement