-- Edward Haber <[EMAIL PROTECTED]> wrote
(on Tuesday, 11 November 2008, 08:24 PM -0500):
> If no file is uploaded, receive() still returns true? Here's an example:

Please test against trunk. The component has undergone a lot of work in
the past two weeks, with basically daily check-ins.

Additionally, read the current docbook documentation from trunk as well.

> if ($form->isValid($formData)) {
>       ... do some stuff ...
>       ... set $product_id to INT ...
>
>       // process form image
>       if ($form->product_image->receive()) {
>               rename($form->product_image->getFileName(), AP . 
> "/media/products/ 
> $product_id.jpg");
>       }
> }
>
> With the above code, if no file is uploaded my destination directory  
> gets renamed. So, if there is no file, receive() is still returning true 
> and getFileName() is equal to the destination directory and consequently 
> the whole directory gets renamed as 5.jpg (for example).
>
> Is this expected or am I implementing incorrectly?! I've asked some dumb 
> questions on this list before. Hopefully this is another one.
>
> BTW, as someone else just noted the docs must be updated! Let me know if 
> i can help. I know some HTML.
> Thx!!
>
>
> On Nov 11, 2008, at 4:55 PM, Simon Corless wrote:
>
>>
>> A quick question to Thomas I suppose, how do I get the file name /  
>> location
>> from a file uploaded using Zend_Form.
>>
>> The docs contradict themselves...
>>
>> In the code it uses:
>> $location = $form->foo->getFileName();
>>
>> Then goes on to state in a note below:
>> "File values
>> Within HTTP a file element has no value. Therefor you will get no  
>> output
>> when calling getValue()."
>>
>> So I suppose it's a small bug in the docs, but ultimately I need the  
>> file
>> name so how do I get it?!
>>
>> Thanks
>> Simon
>>
>> -----
>> Simon
>>
>> http://www.ajb007.co.uk/
>> -- 
>> View this message in context: 
>> http://www.nabble.com/Zend_Form_Element_File---getValue%28%29-in-1.7-tp20449098p20449098.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to