Hello,
I'm stuck in a problem with Zend_File_Transfer_Adapter_Http and I hope somebody
could give me an advice.
I have an html form ( not zend form ) with 2 image element:
<input name="image" type="file" id="image" value="" />
<input name="image_foto" type="file" id="image_foto" value="" />
and I have this code that process the file elements
$adapter = new Zend_File_Transfer_Adapter_Http();
$adapter->setDestination("/my/destination/path");
$adapter->addValidator('Extension', false, 'png,jpg,gif')
->addValidator('Size', false, 8388608)
->addValidator('ExcludeMimeType', false,
'application,audio,message,model,multipart,text,video');*/
$files = $adapter->getFileInfo();
foreach( $files as $fieldname => $fileinfo ) {
$isUploaded = $adapter->isUploaded($fileinfo['name']);
$isValid = $adapter->isValid($fileinfo['name']);
try {
$adapter->receive($fileinfo['name']);
} catch(Zend_File_Transfer_Exception $e) {
echo $e->getMessage();
exit;
}
}
The strange behaviour is the value of $isUploaded and $isValid:
if I upload the same file as FIRST file ( id="image" ), both are true.
if I upload the same file as SECOND file (id="image_foto" ) and the first file
EMPTY, $isUploaded is TRUE but isvalid is FALSE,
when the result I expect is both the value as TRUE.
Same behaviour if I disable all the validator.
Surely there is something I did not get, but what?
Thanks for all your help.
Sergio
_________________________________________________________________
Novità dai tuoi amici? Le trovi su Messenger
http://www.messenger.it/novita.aspx