[mod_python] Reading data from a POST using chuncked mode

Graham Dumpleton graham.dumpleton at gmail.com
Tue Oct 16 08:24:45 EDT 2007


Using chunked encoding on request content is not supported by mod_python. See:

  http://issues.apache.org/jira/browse/MODPYTHON-222

I am surprised you even got as far as your handler executing as it
shouldn't have and you should instead have got an error sent back to
client saying content length expected.

Graham

On 16/10/2007, mohamed35 at freesurf.fr <mohamed35 at freesurf.fr> wrote:
>
> Hi,
>
> 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,
> Thanks,
> Med
>
>
>
>
>
>
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list