Forums

Unable to distribute large files via HTTPS POST request

I am trying to distribute some .zip files from my server to clients by responding to their POST requests with Flask's send_from_directory(). I have no problem distributing smaller files (53kb), but when trying to transmit a 1.7gb file, the client only receives 1.1gb of data which prevents the file from being properly unzipped. Are there any maximum file size limitations for POST requests on pythonanywhere?

We don't have any file size limitations for downloads (though we do for uploads), but there is a time limit -- if a response hasn't been completed within a few minutes (I think it's currently 5) then the request will be aborted. Might that be what's happening in this case?

I just ran a quick test. The program fails after 1 minute 45 seconds and transfers only 1.3gb of the file.

Fixed it! Problem totally on my end. These 2 questions led me to the solution if anyone else has a similar issue. https://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py https://stackoverflow.com/questions/24318084/flask-make-response-with-large-files

Ah, interesting! Thanks for posting the links :-)