title: move_uploaded_file() return false
body: <p>I have a big problem i can't resolve .. </p>
  
  <p>I have to upload multiple file, so that's what i use</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt;
             Seleziona uno o più file&lt;br /&gt;
              &lt;input name="upload[]" type="file" multiple="multiple" /&gt;
              &lt;input type="hidden" name="pathFileToUpload" value="&lt;?php echo $dirToScan ?&gt;"&gt;
              &lt;input type="submit" value="Carica file" /&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>$target_dir = $_POST['pathFileToUpload'];
  $total = count($_FILES['upload']['name']);
    for ($i = 0; $i &lt; $total; $i++) {
      $tmpFilePath = $_FILES['upload']['tmp_name'][$i];
        if (move_uploaded_file($tmpFilePath,$target_dir)) 
              echo "&lt;script&gt;alert('upload')&lt;/script&gt;";
   else 
          echo "&lt;script&gt;alert('Not uploaded')&lt;/script&gt;";
   }     
  </code></pre>
  
  <p>So,what i can see is that the file is correctly passed to the server, so $tmpFilePath contain the temporary path of the file in php, and that $target dir is correct, but the upload goes wrong every time and move_uplaoded_file return false.</p>
  
  <p>I tried too to replace the $target_dir with some path that i'm sure they exist, but nothing.</p>
  
  <p>And the function has the permission to move the file in the server, because first when there was only single upload file it works perfectly ...</p>
  
  <p>PS: I already searched in the forum, but don't found anything that's my case, i try many solutions found as using $_SERVER['Document_root'].'uploads/'  but already nothing ... </p>