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