Why is the ZF so baffling? I'm trying to provide a facility to upload files. I have created an element within the form...
$image = new Zend_Form_Element_File('image');
$image->setLabel('Photo')
->setAttrib('enctype', 'multipart/form-data')
->setRequired(false)
->setDestination('/upload/catalogue/images')
->addValidator('Count', false, 1) // ensure only 1 file
->addValidator('Size', false, 1024000) // limit to 1MB
->addValidator('Extension', false, 'jpg,png,gif'); // only JPEG, PNG, and GIFs
...and the controller consists of...
if ($this->_request->isPost()) {
$formData = $this->_request->getPost();
Zend_Debug::dump($_FILES);
exit;
...but this just returns...
array(0) {
}
i.e. no file is uploaded! I don't understand what I'm doing wrong. Any suggestions?