title: Using PHP move_uploaded_file function permission denied
body: <p>I've been stuck on this code for days as I am hitting this error when I upload a file to the server. Its a windows server running on Apache </p>
  
  <p>Tried various solutions but still receiving the error. I tried changing full permissions to everyone on that server. </p>
  
  <p>I changed the default PHP upload tmp file to inside my application yet I am still having this error. </p>
  
  <p>Warning: move_uploaded_file(C:\My_Workspace\ojs2002) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\My_Workspace\ojs\admin\include\fileupload.php on line 78</p>
  
  <p>Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\My_Workspace\ojs\tmp\phpCB78.tmp' to 'C:\My_Workspace\ojs2002' in C:\My_Workspace\ojs\admin\include\fileupload.php on line 78</p>
  
  <pre><code> // copy the file, making the destination directory if necessary
   $filedir = 'C:/My_Workspace/ojs2002/'.basename($_FILES['articlefile']['name']);
  
  
   chmod($_FILES["articlefile"]["tmp_name"], 0777);
   chmod($filedir, 0777 );        
  
   move_uploaded_file($_FILES["articlefile"]["tmp_name"],$filedir);
  </code></pre>
  
  <p>The code would work fine on Linux servers but not on Windows.</p>
  
  <p>Any help would be very much appreciated. Thank You.</p>