We are going to host our own website. I built up a windows 2003 server. Installed IIS. I am working on file upload to our website. I can get files to upload to c:\Temp but not to c:\Inetpub\wwwroot\ourwebsite\upload.
I even set up the upload directory for full sharing with write permissions. Still no help.
Here is my upload code:
<form enctype="multipart/form-data" action="uploadtest.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="300000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
LIke I say it can upload files to c:\Temp which is read only.
Here is my uploadtest code. uploadtest.php
$uploaddir = "upload\\";
echo '<pre>';
echo "<br />Here is the temporary file --------------------" . $_FILES['userfile']['tmp_name'] . "<br />";
echo "<br />Here is the upload file=====" . $uploadfile . "<br />";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
Unless I make the uploadir = "C:\Temp\" it will not work.
Any help would be greatly appreciated.