Hi there I have a form with a file field which looks like this:
$photo = new Zend_Form_Element_File('image');
$photo->setLabel('Upload your photo.')
->setDecorators($this->_standardElementDecorator)
->setRequired(false)
->setDestination('../data/uploads/')
->addValidator('Size', false, 102400)
->addValidator('Extension', false, 'jpg,png,gif')
->addFilter('Rename',
array('source' => $this->file,
'target' =>
$this->formRename($this->file),
'overwrite' => true));
The code above works fine.
When I try do it like below, it works but the filter is not picked up:
$this->addElement('file', 'file', array(
'decorators' => $this->_standardElementDecorator,
'label' => 'File:',
'required' => true,
'destination' => '../data/uploads',
'filter' => array('Rename',
array('source' => $this->file,
'target' =>
$this->formRename($this->file),
'overwrite' => true),
'validators' => array(
array('StringLength', false,
array(5,40))
),
'required' => true
));
I have tried many variations of this code, but just could not get it right.
Really hope someone can help. Thanks in advance
--
View this message in context:
http://www.nabble.com/File-Rename-Filter-Not-Picked-Up-tp24487426p24487426.html
Sent from the Zend Framework mailing list archive at Nabble.com.