Re: QuickForm - uploading file larger than php.ini POST size blanks out form

From: Date: Wed, 08 Feb 2006 18:31:37 +0000
Subject: Re: QuickForm - uploading file larger than php.ini POST size blanks out form
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22862@lists.php.net to get a copy of this message
On 2/7/06, Luis A. Cruz <lcruz@astaro.com> wrote: > Greetings; here is the issue I am experiencing. Let's say that > my form field allows a file of 5M to be uploaded. My php.ini has > post_max_size = 8M. > > If the user submits a file over 5M but under 8M, the form returns > an error message and the rest of the form fields remain filled > with the posted data. > > If the user submits a file on my form that is over 8M, the form renders > but displays no error message. The rest of the form fields are > now empty as if the form was being hit for the first time or never > posted. > > The php log file records "PHP Warning: POST Content-Length of > 17635382 bytes exceeds the limit of 8388608 bytes in Unknown on > line 0"; no surprise there. But why is the page acting like the > form was never submitted? Is this a limitation of php (file upload > to large; don't act like form was submitted), or is this something > that can be coded around? > Since there's a max size, PHP is likely refusing the entire thing. It wouldn't really be possible to decode the rest of the form elements without the entire POST, so they're left out as if they were never posted. At least, this is what I assume. I suggest adding a notice to the form telling the user to not upload more than a certain size. Also, try adding a PHP error handler and see if it catches that error. If so, you can display a messages. -- Justin Patrin

« previous php.pear.general (#22862) next »