I am trying to add custom error message to my file element validator. It is working for all the elements, BUT file. Kindly point out where am I going wrong. I know similar question has been asked before but I want to know what is the problem with this code?
$file= new Zend_Form_Element_File('albumcover');
$file->setAttrib('size',35)
->removeDecorator('label')
->removeDecorator('htmlTag');
$file->setRequired(true)
->addValidator('Size',true,'1MB')
->addValidator('Count',true,1)
->addValidator('IsImage',true,'jpg,jpeg,png');
$file->addErrorMessage("Upload 'jpg,jpeg or png' file of less than 1MB in size");
It shows predefined errors not the error message that I have set