Using the below following script, I encounter below noted error. What configuration changes need to be made to IIS 5.1 to allow this script to run successfully? Please note, if $path = 'c:\temp\', the selected file is successfully uploaded to the c:\temp folder.
I am running MySQL 4.1.10-nt on a Windows XP SP2 Professional machine. IIS is version 5.1.
I am aware that c:\inetpub\wwwroot\ is probably not the folder to use. In trying to eliminate possible causes, I started with c:\inetpub\, which worked, and then encountered the error condition when I moved on to the next level of folders.
I attemped to update permissions via IIS...I may be taking the wrong actions. Please be specific in steps to take...I am new to IIS and PHP.
Thank you, any possible help would be greatly appreciated.
error messages:
Warning: move_uploaded_file(c:\Inetpub\wwwroot\php_iis_upload_files.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in c:\Inetpub\wwwroot\workbench\utils\uploader_with_form.php on line 26
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\PHP\uploadtemp\php68.tmp' to 'c:\Inetpub\wwwroot\php_iis_upload_files.txt' in c:\Inetpub\wwwroot\workbench\utils\uploader_with_form.php on line 26
script being used to upload a file:
<!--with html form code first, messages are presented after the form -->
<body>
<form method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit">
</form>
<?php
$path = 'c:\temp\';
$path = 'c:\Inetpub\wwwroot\';
if(isset($FILES['file']) && is_uploaded_file($FILES['file']['tmp_name']))
{
$filename = $FILES['file']['tmp_name'];
$destination = $path . $FILES['file']['name'];
if (file_exists($destination))
{ echo 'File already exists!<br />'; }
else
if(move_uploaded_file($filename,$destination))
{ echo 'File uploaded!<br />'; }
else
{ echo ' Failure! <br />'; }
}
?>
<body/>