So I've been going along with the project contained in "Apress, Beginning Zend Framework" and it seems I've hit a bit of a snag.
I'm currently using Zf 1.11 in windows(7 ultimate) w/ IIS.
The code for the controller resides in getUpdateForm() (only including the parts that relate to this):
$form->setAttrib('encytype', 'multipart/form-data');
//Add file upload ability
$fileUploadElement = new Zend_Form_Element_File('avatar');
$fileUploadElement->setLabel('Your Avatar')
->setDestination('../public/users');
$fileUploadElement->addValidator('Count', true, 1);
$fileUploadElement->addValidator('Extension', 'jpg,png,gif');
$form->addElement($fileUploadElement, 'avatar');
The aciton pair then inlcudes the line:
$form->avatar->receive();
As far I understand, this meets the requirement to enable a file upload control on a site. The problem is that whenever I choose an image to upload it says "File: '' is not readable or does not exist."
This lead me to think it was a permissions problem, so I set full permissions for it. Didn't work. Have tried images in dozens of directories. Doesn't work.
I even created a simple script that tests existance, readablility and writability for any seleceted image. It returns true and says they are valid files.
I've spent my first few hours at work here scouring what would cause this and I'm not sure.
I have a feeling this is one of those problems that is going to make me /facepalm when I figure it out.
Any help appreciated. Thanks, Ken
Just an idea: Check the upload temp directory. Is it set? Is it writeable to PHP?
If not, then no file uploads can work and Zend_Form_Element_File will never find a file.