I have two websites: one with Lighttpd with PHP and second with Apache and neither of this handle chunked transfer encoding properly.
I send this request from my mobile, J2ME and there is no possibility to change this transfer type to any other.
So my only way to go is to handle chunked transfer enconcoded requests in other way. Any solution will be good as long as I can enable it on my CentOS server where I can install and change everything that will be necessary.
So my question is: how to handle chunked encoding request properly on server side?
EDIT: Which version of PHP/Apache/LightHTTP are you running? As there was this bug in PHP before, but it seems to be gone with 5.2.13 and 5.3.2.
If the link above doesn't help, I'd like to know exactly what PHP is seeing, can you put this in your api and post the results? (edited down of course).
This way we can see what PHP is seeing, and if it's NOT decoding chunked encoding, then we CAN manually decode it.
End EDIT. (leaving the below in case someone else finds it useful)
I assume this is a followup to your previous question. And I'm assuming you're reading the stream from PHP?
I wrote this a few years back, it reads from a chunked encoded stream, you can then do whatever you want with the output. If it's a large file don't read it into a string, instead write to a file.