By setting the file optional you say "I know that it is possible that there
is no file given".
And for Zend_File_Transfer this means "We know it's optional so I am not
allowed to throw an error and return true in such cases".
Your expectation is simply not correct for this case.
All described methods are in trunk.
But as I wrote they are in different classes.
getFileInfo and isUploaded are only available in the transfer adapter and
not the form element.
And 1.7 is stable and fully functional.
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 7:33 PM
Subject: Re: [fw-general] Check if the file is uploaded, bug?
thomasW wrote:
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)
Because if I didn't send the file, the script can not receive it :)
Thanks for the method list. I am getting an error on getFileInfo() ans
isUploaded(). I guess this methods are not in the trunk yet?
When can we expect 1.7 to go stable?
Regards,
Goran Juric
http://gogs.info/
--
View this message in context:
http://www.nabble.com/Check-if-the-file-is-uploaded%2C-bug--tp20503526p20506069.html
Sent from the Zend Framework mailing list archive at Nabble.com.