title: Image upload with Zend Form trouble determining image extension
body: <p>I'm having trouble determining the file-type of an image I uploaded with Zend Framework.
  Everytime I try to determine the filetype with $_FILES['File']['type'], I always get <em>applicationoctet-stream</em>. Only when I determine the type before checking if the form is posted do I get the right extension. Does anyone know why? Is there a nicer way of dealing with this?</p>
  
  <p>this works:</p>
  
  <pre><code>$form = new Form_Reg;
  $this-&gt;view-&gt;Reg = $form;
  if(isset($_FILES['File']['type'])){
      $filetype = $file = $_FILES['File']['type'];
      }
  
          if ($this-&gt;getRequest()-&gt;isPost()){
  
              $formData  = $this-&gt;_request-&gt;getPost();
              if($form-&gt;isValid($formData)){
  
                  echo $filetype;
                  exit;
  
  
          }
      }
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>    $form = new Form_Reg;
  $this-&gt;view-&gt;Reg = $form;
  
  
  
  
          if ($this-&gt;getRequest()-&gt;isPost()){
  
              $formData  = $this-&gt;_request-&gt;getPost();
              if($form-&gt;isValid($formData)){
                  $filetype = $file = $_FILES['File']['type'];
                  echo $filetype;
                  exit;
  
  
          }
      }
  </code></pre>