title: Zend Form File upload won't validate or upload files
body: <p>I'm trying to do a file upload with Zend Form, but I just cannot get file uploads to work.</p>
  
  <p>Here's my form code:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>public function __construct($options = null)
      {
          parent::__construct($options);
          $this-&gt;setName('modelupload');
          $this-&gt;setMethod('post');
          $this-&gt;setAction('/model/upload');
          $this-&gt;setAttrib('enctype', 'multipart/form-data');
  
          // ... other elements ... //
  
          $file = new Zend_Form_Element_File('file');
          $file
              -&gt;setAttrib('title', 'Select a file to upload.')
              -&gt;setAttrib('required',"")
              -&gt;setRequired(true)
              -&gt;addValidator('Count',false,1)
              -&gt;addValidator('Size',false,104857600)
              -&gt;setMaxFileSize(104857600)
              -&gt;setValueDisabled(true)
              -&gt;setDestination(APPLICATION_PATH . "/../data/models/temp/")
              -&gt;setLabel('Select a file to upload.');
  
          $submit = new Zend_Form_Element_Submit('submit', array(  
              'label' =&gt; 'Upload'  
          ));
          $submit-&gt;removeDecorator('DtDdWrapper');
  
          $this-&gt;setDecorators( array( array('ViewScript',
          array('viewScript' =&gt; 'formViews/_form_upload_model.phtml'))));
  
          $this-&gt;addElements(array($name, $description, $file, $submit));
      }
  </code></pre>
  
  <p>And here is my controller code:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function uploadAction()
  {
      // action body
      error_reporting(E_ALL);
      $this-&gt;view-&gt;pageTitle = "Model Upload";
  
      $form = new Application_Model_FormModelUpload();
  
      if ($this-&gt;_request-&gt;isPost()) {
          $formData = $this-&gt;_request-&gt;getPost();
          if ($form-&gt;isValid($formData)) {
              echo "&lt;h1&gt;Valid&lt;/h1&gt;";
  
              $upload = new Zend_File_Transfer();
              $files  = $upload-&gt;getFileInfo();
  
              $form-&gt;getValues();
  
          } else {
              echo "&lt;h1&gt;Not Valid&lt;/h1&gt;";
          }
          echo "&lt;pre&gt;";
          print_r($formData);
          echo "&lt;/pre&gt;";
      }
  
      $this-&gt;view-&gt;form = $form;
  }
  </code></pre>
  
  <p>And then when I try and upload something, I get this:</p>
  
  <pre class="lang-php prettyprint-override"><code>Not Valid
  Array
  (
      [name] =&gt; title
      [description] =&gt; description
      [MAX_FILE_SIZE] =&gt; 104857600
      [file] =&gt; filename.extension
      [submit] =&gt; Upload
  )
  </code></pre>
  
  <p>I.e the form is <em>not</em> passing validation and I have no idea why. Aside from this, the file <em>isn't</em> being uploaded. I've tried so many things and now I'm at my wit's end. I'm using Zend server CE on my local environment if that makes any difference.</p>
  
  <p>I thank anyone in advance for any help they can offer!</p>
  
  <h1>EDIT:</h1>
  
  <p>Tried MIss poo's code below and got this:</p>
  
  <pre class="lang-php prettyprint-override"><code>Array
  (
  )
  Array
  (
      [name] =&gt; Array
          (
          )
  
      [description] =&gt; Array
          (
          )
  
      [file] =&gt; Array
          (
          )
  
      [submit] =&gt; Array
          (
          )
  
  )
  Array
  (
  )
  </code></pre>
  
  <p>Absolutely no errors being returned...</p>