title: How to set custom error message zend form element file?
body: <p>So I am using Zend and I have a Zend form with a Zend_Form_Element_File and three validators:
  1. setRequired
  2. Extension
  3. Size</p>
  
  <pre><code> $this-&gt;browse = new Zend_Form_Element_File('Browse');
   $this-&gt;browse-&gt;setRequired(false)-&gt;removeDecorator('errors')-&gt;removeDecorator('label')
  -&gt;addValidator('Extension', true, 'pdf')-&gt;addValidator('Size', false, 2000000);
  </code></pre>
  
  <p>I want to set custom error messages for these validators but do not know how.</p>
  
  <p>The reason I want to set a custom error message is because I have a custom decorator with which I grab all errors when the form is not valid with isValid() and display them at the top of the form. The method for which I am grabbing errors in the form is getErrors().</p>
  
  <p>I've also tried: <a href="http://www.mail-archive.com/fw-general@lists.zend.com/msg25779.html">http://www.mail-archive.com/fw-general@lists.zend.com/msg25779.html</a>
  by doing:</p>
  
  <pre><code> $validator = new Zend_Validate_File_Upload();
   $validator-&gt;setMessages(array('fileUploadErrorNoFile' =&gt; 'Upload an image!''));
  </code></pre>
  
  <p>and doing</p>
  
  <pre><code> $this-&gt;browse-&gt;addValidator($validator);
  </code></pre>
  
  <p>Any help?</p>