title: Zend framework file upload illegally uploaded
body: <p>I'm trying to upload files within a normal form with other text fields.</p>
  
  <p>So far, the file gets uploaded to a temp folder but not to my destinationfolder, I always get this error "File 'upload' was illegally uploaded. This could be a possible attack".</p>
  
  <p>I've checked the filename of the tempfile and that has the correct url in the correct folder.</p>
  
  <p>What am I missing here.</p>
  
  <pre><code>        $form = new Zend_Form();
          $form-&gt;setAttrib('enctype', 'multipart/form-data');
          $form-&gt;setMethod('post')
  
               -&gt;addElement('file', 'pdf', array(
                                              'size' =&gt; '40',
                                              'label' =&gt; 'Select File',
                                              'required' =&gt; true,
                                              'validators' =&gt; array(
                                                              'Size' =&gt; array('min' =&gt; 20, 'max' =&gt; 1000000)
                                                              )
                                              )
                          )
  
              -&gt;addElement('submit', 'Save')
          ;
  
          if ( $this-&gt;getRequest()-&gt;isPost() ) {
              if ( $form-&gt;isValid($this-&gt;getRequest()-&gt;getParams()) ) {
                  $id = $form-&gt;getValue('name');
  
                  $upload = new Zend_File_Transfer_Adapter_Http();
                  $uploadDestination = APPLICATION_PATH . '/../public/uploads/'.$id;
  
                  if(!is_dir($uploadDestination)){
                      mkdir($uploadDestination, 0777, true);
                  }
  
                  $upload-&gt;setDestination($uploadDestination);
                  echo $upload-&gt;getFileName();
  
                  if($upload-&gt;receive('pdf'))
                  {
                      echo '&lt;pre&gt;';
                      print_r($form-&gt;getValues());
                      die();
                  }
                  else
                  {
                      $messages = $upload-&gt;getMessages();
                      echo implode("\n", $messages);
                      die();
                  }
  </code></pre>
  
  <p>$upload->receive('pdf'); is what's not working properly.</p>