I am relatively new to web development and currently ran into an error I can't solve.
I use IIS to test my php after typing in "http://localhost/index.html" and select the example file to upload, it generates the following warnings:
Warning: move_uploaded_file(upload/Angela_Nie_resume_technical - EditedMW.doc): failed to open stream: Permission denied in C:\inetpub\wwwroot\test.php on line 26
Warning: move_uploaded_file(): Unable to move 'C:\Windows\Temp\php74F2.tmp' to 'upload/Angela_Nie_resume_technical - EditedMW.doc' in C:\inetpub\wwwroot\test.php on line 26
Below is the code that is related with moving my files.
$target_dir = "upload/";
$target_file = $target_dir . basename( $_FILES["uploaded"]["name"]) ;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target_file)) {
echo "The file has been uploaded";
}
else {
echo "Sorry, there was a problem uploading file.";
}
I am using Windows 8.1 and using IIS to run localhost. Thank you in advance for helping me out!!