title: How to receive a File in Zend Framework 2
body: <p>I am using ZF2.</p>
  
  <p>I am sending a file via a <code>HTML</code> form not generated by <code>Zend/Form</code>. Now I am trying to get that file as i would normally do with <code>$_FILES</code>. I tried the below PHP code but all I get in the <code>print_r is Array ( [upload] =&gt; bnk.csv )</code> </p>
  
  <p>How do I get all the metadata such as temp_dir of that file???.... I am new to Zend so dont know if I am forced to create the form with <code>Zend/Form</code> which seems silly since I only have a file upload field thats a lot easier to manage directly from the view.</p>
  
  <pre><code>$request = $this-&gt;getRequest();
              if($request-&gt;isPost()){
                  $post= array_merge_recursive($request-&gt;getPost()-&gt;toArray(), $request-&gt;getFiles()-&gt;toArray());
                  print_r($post);
              }
  
  
  &lt;form id="upload" method="post" action="bnk/upload/csv" enctype="multipart/form-data"&gt;
          &lt;label for="upload"&gt;Upload CSV File&lt;/label&gt;
          &lt;input type="file" name="upload" /&gt;
          &lt;input type="submit"/&gt;
  &lt;/form&gt;
  </code></pre>