title: zend file upload problems. File not receiving when we upload a file
body: <p>I'm trying upload a file using zend form. I've tried in so many ways but i'm getting the form post data with file name but file was not receiving. Here is my code </p>
  
  <pre><code> **My Form code**
  
  
  public function testUploadForm(){
  
      $imageviewScript = new Zend_Form_Decorator_ViewScript();
      $imageviewScript-&gt;setViewScript('image_element.phtml');
  
      $image_name = new Zend_Form_Element_File('image_name');
      $image_name-&gt;setAttrib('enctype', 'multipart/form-data');
       $image_name-&gt;addValidator('Extension',false,'jpg,png,gif');
          $image_name-&gt;addValidator('Count', false, 1)
          //$image_name-&gt;setRequired(true)
                              -&gt;addDecorator($imageviewScript)
                             -&gt;setDecorators($this-&gt;setFieldElementDecorators());
  
       $submit = new Zend_Form_Element_Submit('submit');
      $submit-&gt;setLabel('Submit')
      -&gt;setAttrib('class', 'addbutton_6')
      -&gt;removeDecorator('label')
      -&gt;setDecorators($this-&gt;getRightSubmitDecorators());
  
      $this-&gt;addElements(array($image_name,$submit));
  
  
  
  }
  </code></pre>
  
  <p><strong>In controller i'm using to receive data like</strong></p>
  
  <pre><code>public function testuploadAction(){
  
      $params= array();
      $this-&gt;_form-&gt;testUploadForm();
  
      if($this-&gt;getRequest()-&gt;isPost()){
  
          $params= $this-&gt;getRequest()-&gt;getParams();
  
          $upload= new Zend_File_Transfer_Adapter_Http();
          $upload-&gt;setDestination(APPLICATION_PATH.'/../images/uploads/');
          if($uploads-&gt;receive()) {
              //Code to process the file goes here
   $filesize = $upload-&gt;getFileSize('image_name');
  </code></pre>
  
  <p>print_r($file_size);exit;</p>
  
  <pre><code>        } else {
              $errors = $upload-&gt;getErrors();
          }
          //$formData = $_POST-&gt;getValues(); //be sure to call this after receive()
          print_r($formData);exit;
          //$file = $upload-&gt;getFileInfo();
          //  $filename = $upload-&gt;getFileName('image_name');          //optional info about uploaded file
  
  
      }
  
      $this-&gt;_form-&gt;populate($params);
      $this-&gt;view-&gt;form= $this-&gt;_form;
  
  
  }
  </code></pre>
  
  <p>when I tried to print the data it was showing warnings like below.</p>
  
  <pre><code>Notice: Undefined index: validators in C:\xampp\htdocs\XXXX\library\Zend\File\Transfer\Adapter\Abstract.php on line 493
  
  Warning: array_search() expects parameter 2 to be array, null given in C:\xampp\htdocs\XXXX\library\Zend\File\Transfer\Adapter\Abstract.php on line 493
  
  Notice: Undefined index: tmp_name in C:\xampp\htdocs\XXXX\library\Zend\File\Transfer\Adapter\Abstract.php on line 589
  
  Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\XXXX\library\Zend\Validate\File\Count.php on line 228
  </code></pre>
  
  <p>No Syntax errors nothing. Form was submitting properly but file was not receiving here. 
  I've changed the file element to Zend file element i'm getting below fatal error after submitting the form.</p>
  
  <p>Fatal error: Uncaught exception 'Zend_File_Transfer_Exception' with message '"image_name" not found by file transfer adapter' in C:\xampp\htdocs\XXXX\library\Zend\File\Transfer\Adapter\Abstract.php:1254 Stack trace: #0 C:\xampp\htdocs\XXXX\library\Zend\File\Transfer\Adapter\Abstract.php(572): Zend_File_Transfer_Adapter_Abstract->_getFiles('image_name') #1 C:\xampp\htdocs\XXXX\library\Zend\Form\Element\File.php(435): Zend_File_Transfer_Adapter_Abstract->isValid('image_name') #2 C:\xampp\htdocs\XXXX\library\Zend\Form.php(1987): Zend_Form_Element_File->isValid('shreyansh-ipad ...', Array) #3 C:\xampp\htdocs\XXXX\application\controllers\CustomerController.php(41): Zend_Form->isValid(Array) #4 C:\xampp\htdocs\XXXX\library\Zend\Controller\Action.php(503): CustomerController->registerAction() #5 C:\xampp\htdocs\XXXX\library\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch('registerAction') #6 C:\xampp\htdocs\XXXXX\library\Zend\Controller\Front.php(934): Zend_Co in C:\xampp\htdocs\XXXXX\library\Zend\File\Transfer\Adapter\Abstract.php on line 1254</p>
  
  <p>Can some one plz suggest why the files are not uploading for me. Thank you.</p>