title: Permission denied while uploading a file
body: <p>I am using this code to upload a document to my server. </p>
  
  <pre><code>&lt;?php
  if ($_FILES["file"]["error"] &gt; 0){
  echo "Error: " . $_FILES["file"]["error"] . "&lt;br&gt;";
  }else{
  echo getcwd().'&lt;br&gt;';
  echo "Upload in file named: " . $_FILES["file"]["name"] . "&lt;br&gt;";
  $info = pathinfo($_FILES['userFile']['name']);
  $ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
  $target = 'upload/100.'.$ext;
  move_uploaded_file( $_FILES['file']['tmp_name'], $target);
  }
  
  ?&gt;
  </code></pre>
  
  <p>I am getting these error message:</p>
  
  <blockquote>
    <p>Warning: move_uploaded_file(C:\Inetpub\vhosts\api.cutm.ac.in\httpdocs\UploadMarks\upload\100.docx) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\vhosts\api.cutm.ac.in\httpdocs\UploadMarks\uploadFile.php on line 14</p>
    
    <p>Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Windows\Temp\phpF64C.tmp' to 'C:\Inetpub\vhosts\api.cutm.ac.in\httpdocs\UploadMarks\upload\100.docx' in C:\Inetpub\vhosts\api.cutm.ac.in\httpdocs\UploadMarks\uploadFile.php on line 14</p>
  </blockquote>
  
  <p>What am I doing wrong? What changes do I need in my code? Please help me in this regard.</p>