Well, according to the manual and the API the method addValidators() (note
the s for plural) is for adding multiple validators and needs an array as
input.
And the method addValidator() (note the missing s for singular) uses the
notation you mentioned.
Please read the manual and the examples and look in the API.
Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com
----- Original Message -----
From: "cybershark" <[EMAIL PROTECTED]>
To: <fw-general@lists.zend.com>
Sent: Saturday, October 11, 2008 3:58 PM
Subject: [fw-general] Zend_File_Transfer Fatal error
Hi
whatever I try I end up with the error below:
Catchable fatal error: Argument 1 passed to
Zend_File_Transfer_Adapter_Abstract::addValidators() must be an array,
string given, called in F:\wwwroot\ultitecwww\admin\admin.php on line 174
and defined in F:\wwwroot\library\Zend\File\Transfer\Adapter\Abstract.php
on
line 333
I'm using 1.6.1, I'm not using the whole framework and I'm only using
Zend_File_Transfer.
$upload = new Zend_File_Transfer_Adapter_Http();
$upload->addValidators('Size', '250kB')
->addValidators('Count', 5)
->addValidators('FilesSize', '1MB')
->addValidators('Extension', 'gif, jpg, png')
->addValidators('ImageSize', array(10, 10, 1024, 768))
->setDestination('C:/uploads');
if (!$upload->isValid()) {
print_r($upload->getMessages());
die();
}
try {
$upload->receive();
} catch (Zend_File_Transfer_Exception $e) {
$e->getMessage();
}
--
View this message in context:
http://www.nabble.com/Zend_File_Transfer-Fatal-error-tp19932788p19932788.html
Sent from the Zend Framework mailing list archive at Nabble.com.