Why don't you simply specify the maximum filesize ?

->addValidator('Size', array('0kB', '100kB'))

Only specifying the minimum is not intended to work, is it ? :-)
You could also try to use the RC2... there are a number of changes included which could affect you.

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com


----- Original Message ----- From: "Maxime P" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, August 18, 2008 4:00 PM
Subject: Re: [fw-general] Zend_File_Transfer



Thanks Thomas!

Here my code:

Controller
$adapter = $form->photo->getTransferAdapter();
$adapter->setDestination('C:/uploads')
->addValidator('Size', '100kB')  //Don't work
->addValidator('Extension',  array('gif', 'jpg', 'png'));

if (!$adapter->isValid('photo')) {
   print_r($adapter->getMessages());
}

try {
$adapter->receive();
} catch (Zend_File_Transfer_Exception $e) {
$e->getMessage();
}

form
/*File Field*/
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Votre Photo');


But now, i have a problem on the Size validator even though the Extension
Validator works.

When i submit the form, it returns:
Array ( [fileSizeTooSmall] => The file 'Array' is smaller than allowed )




--
View this message in context: http://www.nabble.com/Zend_File_Transfer-tp19024470p19032380.html Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to