Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Trivial
-
Resolution: Not an Issue
-
Affects Version/s: 1.7.2
-
Fix Version/s: None
-
Component/s: Zend_File_Transfer
-
Labels:None
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.
Issue Links
| This issue is dependecy of: | ||||
| ZF-5357 | Error by Upload |
|
|
|
I forgot the 'multipart/form-data' encoding, my bet, can be closed