ok, getting some funny goings on. The problem has something to do with setRequired() set to false. Set to true there are no problems.
Also, when you add a second File upload element to the form, the second element will recieve the error from the first element? so this is fine: $element = new Zend_Form_Element_File('image'); $element->setDecorators($this->_standardElementDecorator) ->setLabel('Upload an image:') ->setRequired() ->addValidator('Count', false, 1) ->addValidator('Size', false, 102400) ->addValidator('Extension', false, 'jpg,png,gif') ->addValidator('MimeType', false, array('image/jpeg', 'image/png', 'image/gif')); $this->addElement($element); remove "setRequired()" and no error $element = new Zend_Form_Element_File('image'); $element->setDecorators($this->_standardElementDecorator) ->setLabel('Upload an image:') ->addValidator('Count', false, 1) ->addValidator('Size', false, 102400) ->addValidator('Extension', false, 'jpg,png,gif') ->addValidator('MimeType', false, array('image/jpeg', 'image/png', 'image/gif')); $this->addElement($element); remove "setRequired()" and add extra file upload element and you get one error (the error of the first element on the second element) $element = new Zend_Form_Element_File('image'); $element->setDecorators($this->_standardElementDecorator) ->setLabel('Upload an image:') ->addValidator('Count', false, 1) ->addValidator('Size', false, 102400) ->addValidator('Extension', false, 'jpg,png,gif') ->addValidator('MimeType', false, array('image/jpeg', 'image/png', 'image/gif')); $this->addElement($element); $element = new Zend_Form_Element_File('image 2'); $element->setDecorators($this->_standardElementDecorator) ->setLabel('Upload an image 2:') ->addValidator('Count', false, 1) ->addValidator('Size', false, 102400) ->addValidator('Extension', false, 'jpg,png,gif') ->addValidator('MimeType', false, array('image/jpeg', 'image/png', 'image/gif')); $this->addElement($element); thomasW wrote: > > I've already added it several days ago. > You can try it out by using the trunk repository or you have to wait until > the next subrelease comes out. > > Greetings > Thomas Weidner, I18N Team Leader, Zend Framework > http://www.thomasweidner.com > > ----- Original Message ----- > From: "gerardroche" <[EMAIL PROTECTED]> > To: <fw-general@lists.zend.com> > Sent: Thursday, September 04, 2008 5:45 PM > Subject: [fw-general] Zend_Form_Element_File & MimeType validator > > >> >> Is the MimeType validator available in Zend_Form_Element_File ZF1.6? >> >> >> http://framework.zend.com/manual/en/zend.file.transfer.validators.html >> >> >> $upload = new Zend_File_Transfer(); >> >> // Limit the mimetype of all given files to gif images >> $upload->addValidator('MimeType', 'image/gif'); >> >> // Limit the mimetype of all given files to gif and jpeg images >> $upload->setValidator('MimeType', array('image/gif', 'image/jpeg'); >> >> // Limit the mimetype of all given files to the group images >> $upload->setValidator('MimeType', 'image'); >> -- >> View this message in context: >> http://www.nabble.com/Zend_Form_Element_File---MimeType-validator-tp19313492p19313492.html >> Sent from the Zend Framework mailing list archive at Nabble.com. > > > -- View this message in context: http://www.nabble.com/Zend_Form_Element_File---MimeType-validator-tp19313492p19448537.html Sent from the Zend Framework mailing list archive at Nabble.com.