title: PHP: upload files to network shared folder
body: <p>I have a problem uploading file to a network shared folder. I can connect to the folder by using windows authentication in IE. The script is as followed:</p>
  
  <pre><code>$target_path =  '\\\\server\\images\\';
  $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 
  if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
      echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
      " has been uploaded";
  } else{
      echo "There was an error uploading the file, please try again!";
  }
  </code></pre>
  
  <p>when i ran it , I got an error message read:</p>
  
  <blockquote>
    <p>Warning:
    move_uploaded_file(\server\images\pic_firefox.jpg) [function.move-uploaded-file]: failed
    to open stream: Permission denied in
    C:\xxxxxxxxx\uploader.php  on line 6</p>
  </blockquote>
  
  <p>I thought that's because windows authentication doesn't work this way. Is there a way I can upload the file by using username/password? Any thoughts would be appreciated.</p>