Skip to content
Advertisement

Progress of Python requests post

I am uploading a large file using the Python requests package, and I can’t find any way to give data back about the progress of the upload. I have seen a number of progress meters for downloading a file, but these will not work for a file upload.

The ideal solution would be some sort of callback method such as:

JavaScript

Thanks in advance for your help :)

Advertisement

Answer

requests doesn’t support upload streaming e.g.:

JavaScript

btw, if you don’t need to report progress; you could use memory-mapped file to upload large file.

To workaround it, you could create a file adaptor similar to the one from urllib2 POST progress monitoring:

JavaScript

Example

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement