As I said... It's Matthews component, not mine. :-)

I would expect a getFile Method to return the file, but not the getValue method. And how will you then get the name and location of the stored file ? That's what getValue() returns now.

Also beware: Allowing getValue to return the file does also mean the getValue will throw exceptions when there are file upload problems which is now not the case.

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

----- Original Message ----- From: "Jaka Jancar" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, August 15, 2008 12:18 PM
Subject: Re: [fw-general] Zend_Form_Element_File


It's not really illogical.

You create Zend_Form_Element_Text, you get text as value, not the name of the variable it's stored in :)

If you have a Zend_Db_Table_Row, which has fields corresponding to the form element, you can just to:

$row->setFromArray($form->getValues());

I would expect the _value_ of the File element to get stored in a BLOB field, just as I expect the value of a Text element to get stored in a VARCHAR field (for example), not some filesystem path.

Regards,
 Jaka Jancar

On 15. Aug 2008, at 12:08, Thomas Weidner wrote:

Why should "getValue()" do a file transfer ???
That's unlogical.

A Value is not an action... and transferring a file is an action.

That's why we wrote a documentation and examples. So others know how to use the component. When you think that what I said is unlogical you should ask Matthew or add an issue, because Zend_Form is his component and not mine. :-)

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

----- Original Message ----- From: "Tobias Gies" <[EMAIL PROTECTED]
>
To: "Matthew Lurz" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Friday, August 15, 2008 10:05 AM
Subject: Re: [fw-general] Zend_Form_Element_File


2008/8/13 Matthew Lurz <[EMAIL PROTECTED]>


Thanks Thomas. I, quite wrongly, assumed that getValue would call
Zend_File_Transfer_Adapter_Http:: receive() transparently. It's working
now. Thanks again.


This actually sounds like a valid (and sensible) feature request. Thomas,
what's your opinion on this?

Regards,
Tobias


Reply via email to