Issues

ZF-5363: Zend_File_Transfer_Adapter_Abstract does not handle file uploads when no file is uploaded

Issue Type: Bug Created: 2008-12-28T08:21:31.000+0000 Last Updated: 2009-01-02T13:08:13.000+0000 Status: Resolved Fix version(s): Reporter: michal kralik (ceecko) Assignee: Thomas Weidner (thomas) Tags: - Zend_File_Transfer

Related issues: - ZF-5357

Attachments:

Description

Zend_File_Transfer_Adapter_Abstract does not handle file uploads when no file is uploaded by the user.

Example code

<pre class="literal">
$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

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts