[mod_python] Reading data from a POST using chuncked mode

mohamed35 at freesurf.fr mohamed35 at freesurf.fr
Tue Oct 16 08:04:45 EDT 2007


I used to use req.read() to retrieve raw data from a POST request
(application/pdf) which represents a quite large quantity of data (non
chunked mode).

Now, client is using chunked transfer (HTTP_TRANSFER_ENCODING = chunked), to
avoid blocking a lot of memory at client (mime not used).

I have problems retrieving the data (my saved files are 0 bytes size!) with
the chunked transfer

According to mod_python documentation about the read():
"This function relies on the client providing the Content-length  header.
Absence of the Content-length header will be treated as if Content-length: 0
was supplied."

Is the problem due to the fact that no Content-length header is provided to
modpython by apache?

Does anyone know what should be the proper way of handling chanked transfer
of data with mod_python? Is read() appropriate or any other coding necessary?

Any help is very welcome,

More information about the Mod_python mailing list