The task is simple: on the server side (python) accept HTTP POST, which contains the downloaded file and other form parameters.
I am trying to implement a download progress indicator, and therefore I need to be able to read the contents of the file block by block.
All the methods I found are based on cgi.FieldStorage, which somehow only allows me to get the whole file (in memory, which in itself is a disaster). Some recommend overriding the FieldStorage.make_file () method, which seems to destroy the cgi implementation (weird ...).
Currently, I can read all the input of wsgi, chunk by chunk, into the file system, resulting in the following data:
-----------------------------9514143097616
Content-Disposition: form-data; name="myfile"; filename="inbound_marketing_cartoon_ebook.pdf"
Content-Type: application/pdf
... 1.5 MB of PDF data
-----------------------------9514143097616
Content-Disposition: form-data; name="tid"
194
-----------------------------9514143097616--
- , Python, ?
? (Python 2.5, )
.