title: Problem uploading file in php
body: <p>I have a simple but annoying problem and I don't understand the reason. I need to upload a simple csv file with php. Here's my code:</p>
  
  <p>index.php:</p>
  
  <pre><code>&lt;form method="post" action="upload.php" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="file" id="file" /&gt;
      &lt;input type="submit" value="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>upload.php:</p>
  
  <pre><code>$upfile = "csv/".$_FILES["file"]["name"];
  move_uploaded_file($_FILES["file"]["tmp_name"], $upfile);   
  </code></pre>
  
  <p>No errors whatsoever, but the file is still not uploaded on the server.</p>
  
  <p>UPDATE: print_r($_FILES) output:</p>
  
  <pre><code>Array ( [fileUpload] =&gt; Array ( [name] =&gt; file1.csv [type] =&gt; text/comma-separated-values [tmp_name] =&gt; /var/tmp/php6YZ4Bt [error] =&gt; 0 [size] =&gt; 45 ) )
  </code></pre>