Thanks for the reply Thomas.

I added this line to the form (via Zend_Form of course, but this is the html
output):
<input id="MAX_FILES_SIZE" type="hidden" value="6291456"
name="MAX_FILES_SIZE"/>

I'm using Zend Framework 1.7.4 (downloaded about a week ago). I have no
experience with Subversion so I'm not sure how to download the svn trunk.




thomasW wrote:
> 
> Which release are you using ?
> Can you try svn trunk ?
> 
> How did you add the MAX_FILES_SIZE ?
> Where did you add it ?
> 
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
> 
> ----- Original Message ----- 
> From: "bytte" <[email protected]>
> To: <[email protected]>
> Sent: Tuesday, February 10, 2009 4:43 PM
> Subject: [fw-general] User uploads file bigger than what's allowed in 
> php.ini, can it be caught?
> 
> 
>>
>> I'm using Zend_File via Zend_Form_Element_File to let my web
>> application's
>> users upload files. I use the following Validators:
>> $file1->setRequired(true)
>>        ->addValidator('NotEmpty',true)
>>    ->addValidator('Count',false,array('min' => 1, 'max' => 1))
>>    ->addValidator('MimeType', true, array('application/pdf'))
>>    ->addValidator('Extension',false,array('pdf'))
>>    ->addValidator('Size',false,array('max' => '6MB'));
>>
>> It works ok and the validators seem to do their job well but on one
>> occasion: when the user tries to upload a file that's bigger than what's
>> allowed in the server's php.ini file. That value is set to 10MB and when
>> I
>> upload a file of let's say 12MB I just get this error:
>>
>> Fatal error: Uncaught exception 'Zend_File_Transfer_Exception' with 
>> message
>> '"file1" not found by file transfer adapter'.
>>
>> If the user tries to upload a file that's bigger than 6MB (as defined in 
>> the
>> Size validator) but smaller than 10MB it's ok as a user-friendly message 
>> is
>> shown to the user.
>>
>> Is there a way to display a user-friendly message to the user when he/she
>> tries to upload a file bigger than what's allowed in php.ini? Now it just
>> looks as if the application is broken.
>>
>> For the record: I have set html's MAX_FILES_SIZE to 6MB as well.
>> -- 
>> View this message in context: 
>> http://www.nabble.com/User-uploads-file-bigger-than-what%27s-allowed-in-php.ini%2C-can-it-be-caught--tp21936346p21936346.html
>> Sent from the Zend Framework mailing list archive at Nabble.com. 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/User-uploads-file-bigger-than-what%27s-allowed-in-php.ini%2C-can-it-be-caught--tp21936346p21943430.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to