Laurent,

getValues does NOT access $_FILES.
This you have misunderstood. The $_FILES array is used as input for the transfer adapter. But again, it does not work with the $_FILES array. The internal representation of the data is different to $_FILES.

So you said that you are not displaying the form but do this yourself.
As long as you are following the syntax of the HTTP file element it should work. But when you use subforms or multifiles and are not using the file decorator you must do the normalisation manually.

This exception you are referring to does simply say:
The file element you requested is not defined, nor is it a filename or a temporary name... I don't know which data you want to work with.

As you gave no details it's hard to say something specific to this problem.

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

----- Original Message ----- From: "Laurent Melmoux" <[EMAIL PROTECTED]>
To: "Zend Framework General" <fw-general@lists.zend.com>
Sent: Wednesday, December 03, 2008 3:01 PM
Subject: [fw-general] Zend_Form + Zend_File_Transfer issue with Zend_Form::getValues()


Hi guys, Matthew, Thomas,

I’m giving a try to Zend_Form + Zend_File_Transfer and I’m facing a issue with Zend_Form_Element_File::getValue()

I’m not using Zend_Form to renders my forms.
Before displaying the form (on create or update) I populate it with default values or values from the db and then I’m using Zend_Form::getValues() to pass form values to the view.

But here with files element Zend_Form_Element_File::getValue() try to access the global $_FILES and as no form has been submitted yet an exception thrown :

throw new Zend_File_Transfer_Exception(sprintf('"%s" not found by file transfer adapter', $find));

See :
Zend_File_Transfer_Adapter_Abstract ::getFileInfo($file = null)
Zend_File_Transfer_Adapter_Abstract ::_getFiles($files, $names = false, $noexception = false)

Is it a issue or am I using incorrectly Zend_Form + Zend_File_Transfer ?

Regards,

--
Laurent Melmoux
Conseil et Solutions Web | [EMAIL PROTECTED]
2mx - Annecy, France | http://laurent.2mx.fr/

Reply via email to