ZF-5363: Zend_File_Transfer_Adapter_Abstract does not handle file uploads when no file is uploaded
Description
Zend_File_Transfer_Adapter_Abstract does not handle file uploads when no file is uploaded by the user.
Example code
$f = new Zend_Form();
$f->addElement('file', 'photo', array(
'label' => 'photo',
'required'=> false
))
->addElement('submit', 'save', array('label' => 'btn_save'));
if($_POST && $f->isValid($_POST)) {
echo 'valid';
}
echo $f->render(new Zend_View());
Exception is thrown when form is submitted: "photo" not found by file transfer adapter The problem is on line 572, Zend/File/Transfer/Adapter/Abstract.php, where validation does not consider option ignoreNoFile for the adapter.
Comments
Posted by michal kralik (ceecko) on 2008-12-29T03:49:42.000+0000
I forgot the 'multipart/form-data' encoding, my bet, can be closed