Topic: Server fails to decode multipart header
Hi,
The same plupload code that works nice on a server hosted by O2Swich fails when it is hosted on free.fr (Proxad service) server. More, even the plupload demo fails to upload on this hosting.
I spend hours to try to understand what was happening and I finally found that on free.fr servers the mutipart/form-data header is not decoded by apache and is included in the file, resulting in 2 things :
1) All parameters are lost ($_POST variable is empty) and upload.php is not able to retrieve the file name name or chunk number, leaving files with random name got from $fileName = uniqid("file_");
2) The multipart headers are included in the file generated for first chunk sent, exactly as reported in this discussion : http://www.plupload.com/punbb/viewtopic.php?id=15266
Stupidly, I spent hours and hours trying to understand what was happening, before discovering that this occurs when chunk size is close enough to post_max_size returned by the server.
On free.fr hosting, phpinfos() tells that post_max_size = 2MB, so I set plupload chunksize : '2mb' too ... and it failed. But it works after reducing chunk_size: '1.95 mb'. :-(
I think it would be better that plupload checks itself the max upload size (by a query to upload.php) and then ensure chunk size + multipart headers NEVER overrun the max size !
Hope it may help...