You should eighter use Zend_Form_Element_File or Zend_File_Transfer.
As Zend_Form_Element_File uses it's own instance of Zend_File_Transfer you
are working with 2 instances, which probably leads to the error.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "Maxime P" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, August 18, 2008 1:56 AM
Subject: [fw-general] Zend_File_Transfer
Hi!
I'm trying to use Zend_FIle_Transfer but i have an error when i submit my
form.
I use this code:
http://www.framework.zend.com/manual/fr/zend.file.html#zend.file.transfer.introduction
http://www.framework.zend.com/manual/fr/zend.file.html#zend.file.transfer.introduction
In my_form:
/*File Field*/
$photo = new Zend_Form_Element_File('photo');
$photo->setLabel('Votre Photo')
->setRequired(true);
In my Controller
if($this->_request->isPost()) {
$formData = $this->_request->getPost();
if($form->isValid($formData)) {
$adapter = new Zend_File_Transfer_Adapter_Http();
$adapter->setDestination('/');
if (!$adapter->receive()) {
$messages = $adapter->getMessages();
echo implode("\n", $messages);
}
}
}
and for any picture I upload, $messages return this "The file 'photo' was
illegal uploaded, possible attack "
Thanks for your help! & sorry for my english ;)
--
View this message in context:
http://www.nabble.com/Zend_File_Transfer-tp19024470p19024470.html
Sent from the Zend Framework mailing list archive at Nabble.com.