[Answered ]-Django served file returned empty on windows, not on mac

2đź‘Ť

âś…

For windows, you need to add “rb” to file.

like so:

wrapper = FileWrapper(file(tarfilename,'rb'))

Also, Content-Length should use a integer, not a string

like so:

response['Content-Length'] = os.path.getsize(tarfilename)
👤michael

Leave a comment