title: Zend Framework 1.12 - Zend Form File element triggering wrong validation messages
body: <p>I have looked through similar answers but couldn't find any solution. </p>
  
  <p>I have a file element in one of my forms. This element is defined below.</p>
  
  <pre><code>$file = $this-&gt;createElement('file', 'templateFile');
  $file-&gt;setAttrib('id', 'templateFile')
       -&gt;setAttrib('class', 'form-control')
       -&gt;setAttrib('placeholder', 'File containing template headers')
       -&gt;setLabel('Template File &lt;span class="glyphicons glyphicons-sheriffs_star requiredFlag"&gt;&lt;/span&gt;')
       -&gt;setRequired(true)
       -&gt;addValidator('NotEmpty', false)
       -&gt;addValidator('Count', false, 1)
       -&gt;addValidator('Size', false, '1MB')
       -&gt;addValidator("Extension", false, array('csv', 'txt'))
       -&gt;addFilter('StringTrim');
  
  $file-&gt;getValidator('NotEmpty')-&gt;setMessage('Please select a template file');
  $file-&gt;getValidator('Count')-&gt;setMessage(' Please upload one file at a time');
  $file-&gt;getValidator('Size')-&gt;setMessage('File exceeds the upload limit of 1 MB');
  $file-&gt;getValidator('Extension')-&gt;setMessage('Invalid file extension. Only CSV and TXT files are allowed');
  </code></pre>
  
  <p>I am using custom error messages with this element and this is what is causing problems.</p>
  
  <p>When I submit a form without choosing a file rather then triggering the NotEmpty validation error message I see the message below.</p>
  
  <pre><code>File 'qhepstow_dblive.sql' exceeds the defined form size
  </code></pre>
  
  <p>How can I trigger the following error message when the file is not selected and avoid the once mentioned above?</p>
  
  <p>This error message should be displayed when the file is not selected.</p>
  
  <pre><code>Please select a template file
  </code></pre>
  
  <p>Thanks for your help.</p>