Consider the following:
$form = new Zend_Form();
$element = new Zend_Form_Element_File('pictures');
$element->setDestination(realpath(APP_ROOT . '/temp'))
->setIsArray(true)
->setMultiFile(2);
$form->addElement($element);
$form->setAttrib('enctype', 'multipart/form-data');
$form->addElement('submit', 'Submit');
if ($this->getRequest()->isPost()) {
if ($form->isValid($_POST)) {
print_r($form->getElement('pictures')->getValue());
}
}
The first file uploads fine but the second gives me a warning that looks something like this: Warning: move_uploaded_file(Array\{filename})
For some reason its setting to the destination directory for the second file to an array for some reason.
没有评论:
发表评论