Why do you expect that receive returns a false when the file was not uploaded ? :-)

When you set the file element to be optional receive will of course return true because it does not return is a file was uploaded but if the previous defined actions were successfull or not. And as you defined the file element to be optional it's ok for receive.

Receive is not the isUploaded method.

According to manual you could use
* getValue() (with 1.7)
* getFileName() (with directory check as no filename is attached to the set directory) * getFileInfo (the 'name' key will be empty in this case, and the isUploaded key (1.7) will be false)
* the isUploaded method (with 1.7 in file adapter)

Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

----- Original Message ----- From: "Goran Juric" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, November 14, 2008 5:16 PM
Subject: [fw-general] Check if the file is uploaded, bug?



How to check if the file was uploaded after the form is submitted?

I've tried var dumping $form->fileElement->receive() but I get a boolean
'true' in both cases (with and without the file uploaded).

Is this a bug, or is there another way to check if the file has been
uploaded?

Regards,

Goran Juric
http://gogs.info/
--
View this message in context: http://www.nabble.com/Check-if-the-file-is-uploaded%2C-bug--tp20503526p20503526.html Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to