Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bytes = os.path.getsize(path)
- f = file(path, 'r')
- response = HttpResponse(FileWrapper(f), content_type='application/octet-stream')
- response['Content-Disposition'] = 'attachment; filename=' + filename
- response['Content-Length'] = bytes
Add Comment
Please, Sign In to add comment