Hello all,
The task is simple: on the server side (python) accept an HTTP POST which contains an uploaded file and more form parameters.
I am trying to implement upload progress indicator, and therefore I need to be able to read the file content chunk-by-chunk.
All methods I found are based on cgi.FieldStorage, which somehow only allows me to obtain the file in its entirety (in memory, which is a disaster in itself). Some advise to redefine the FieldStorage.make_file method(), which seems to break down the cgi implementation (weird...).
I am currently able to read the entire wsgi input, chunk by chunk, to the filesystem, 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--
Does anyone know if there are any Python libraries that could reliably parse this thing? Or should I do this manually? (Python 2.5 that is)
Thanks.