Well, maybe someone else can help you. I am not able to help unless I see
how you are processing the uploads.
The config file is not enough, but I said this already in past.
File uploads ARE tricky. This is the reason why I need more information to
help. Best would be reproducable code.
Have you tried trunk ? This is a very fresh component and there is
development nearly on daily basis. Maybe what you got is already fixed on
the way to 1.7. Else I need more information to reproduce your behaviour.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "Maax V" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, October 30, 2008 2:43 PM
Subject: Re: [fw-general] php warning when using Zend Form File
I indeed created my own element when ZF did not have a file element (I named
it File.php and putted it in Zend/Form/Element). But now that ZF have a file
element, i'm not using my own class anymore.
Here is my understanding of using ZendForm along with a ZendConfig element :
<fileInput> defines the html id of the element
<type>file</type> defines the type of the Zend Form Element
(Image/Captcha)
<options>
<label>F_PHOTOUPLOAD_IMAGEFILE</label>
<validators>
<count>
<validator>Count</validator>
<options>
<count>1</count>
</options>
</count>
</validators>
</options>
</fileInput>
So from what i understand fileInput can be named however i want... But I'll
read again the reference manual, maybe i missed something.
Anyway here is the full config for my form :
<photoUpload>
<action>/archives/upload</action>
<method>post</method>
<enctype>multipart/form-data</enctype>
<autocomplete>off</autocomplete>
<id>photosForm</id>
<elements>
<fileInput>
<type>file</type>
<options>
<label>F_PHOTOUPLOAD_IMAGEFILE</label>
<validators>
<count>
<validator>Count</validator>
<options>
<count>1</count></options></count></validators>
</options>
</fileInput>
<patronInput>
<type>text</type>
<options>
<label>F_PHOTO_PATRON</label>
<description>Préfixe + Numéro + Version</description>
</options>
</patronInput>
<iiInput>
<type>text</type>
<options>
<label>F_PHOTO_INVENTAIRE</label>
<attribs>
<title>Inventaire informatique</title>
</attribs>
</options>
</iiInput>
<labelInput>
<type>text</type>
<options>
<label>F_PHOTO_LABEL</label>
<required>true</required>
</options>
</labelInput>
<articleInput>
<type>text</type>
<options>
<label>F_PHOTO_ARTICLE</label>
</options>
</articleInput>
<orderInput>
<type>text</type>
<options>
<label>F_PHOTO_ORDRE</label>
</options>
</orderInput>
<orderChainInput>
<type>text</type>
<options>
<label>F_PHOTO_CHAINE_ORDRE</label>
</options>
</orderChainInput>
<stylesInput>
<type>text</type>
<options>
<label>F_PHOTO_STYLES</label>
<decorators>
<label>
<decorator>Label</decorator>
<options>
<class>required</class>
</options>
</label>
</decorators>
<autocomplete>1</autocomplete>
</options>
</stylesInput>
<tagsHidden>
<type>hidden</type>
<options>
<required>true</required>
<value></value>
</options>
</tagsHidden>
<colorisInput>
<type>text</type>
<options>
<label>F_PHOTO_COLORIS</label>
<autocomplete>4</autocomplete>
</options>
</colorisInput>
<attributsInput>
<type>text</type>
<options>
<label>F_PHOTO_ATTRIBS</label>
<autocomplete>3</autocomplete>
</options>
</attributsInput>
<descriptionInput>
<type>textarea</type>
<options>
<label>F_PHOTO_DESCRIPTION</label>
</options>
</descriptionInput>
<MAX_FILE_SIZE>
<type>hidden</type>
<options>
<value>20971520</value>
</options>
</MAX_FILE_SIZE>
<submit>
<type>submit</type>
<options>
<label>F_PHOTOUPLOAD_SUBMIT</label>
</options>
</submit>
</elements>
</photoUpload>
thomasW wrote:
Could be... but you are not using the ZF file element.
Your form says it:
Warning: Unknown file in
/home/www/client/htdocs/com.*****.wip/library/Zend/Form/Element.php on
line
1923
It's not the file element which triggers the warning it's the element
itself
based on your configuration.
So I expect that your config is not correct.
Also I do not see that you are creating a file element.
Have you created your own element ?
Because a fileInput element does not exist in ZF.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "Maax V" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, October 30, 2008 10:42 AM
Subject: Re: [fw-general] php warning when using Zend Form File
Well, the rest of the code is pretty classic i guess :
$uploadform = new Zend_Config_Xml(ROOT_DIR.'/application/forms.xml',
'photoUpload');
$form = new Zend_Form($uploadform);
$this->view->form = $form;
- The rest of the elements works, only the file element gives the warning
and is not displayed
- It happens at display
- The code works with 1.6.1 but not with 1.6.2 or 1.7PR
thomasW wrote:
I dont think that we can help without any information about the code you
produced.
The ini file is not enough to see what you called and how you called it.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "Maax V" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, October 29, 2008 10:05 AM
Subject: [fw-general] php warning when using Zend Form File
Hi all,
I receive the following warning when I try to use Zend Form File
Element
(indirectly throw Zend Form and a Zend Config object) :
Warning: Unknown file in
/home/www/client/htdocs/com.*****.wip/library/Zend/Form/Element.php on
line
1923
I don't understand why I get this error. It appeared after I updated to
ZF
1.6.2 (minimal) whereas it was working fine with the exact same code
earlier.
Here is the Zend Config object that generate the Element :
<fileInput>
<type>file</type>
<options>
<label>F_PHOTOUPLOAD_IMAGEFILE</label>
<validators>
<count>
<validator>Count</validator>
<options>
<count>1</count>
</options>
</count>
</validators>
</options>
</fileInput>
The rest of the Form works just fine.
Please tell me what I'am doing wrong here and excuse my bad english !
--
View this message in context:
http://www.nabble.com/php-warning-when-using-Zend-Form-File-tp20223122p20223122.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
View this message in context:
http://www.nabble.com/php-warning-when-using-Zend-Form-File-tp20223122p20243527.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
View this message in context:
http://www.nabble.com/php-warning-when-using-Zend-Form-File-tp20223122p20247275.html
Sent from the Zend Framework mailing list archive at Nabble.com.