Hello everybody,

I use PHP (with MySQL) on a Windows2000 machine. For an application that I
am writing I need a simple straight forward file upload system through a
form, like this:

echo "
<form action=\"Example_Action.php\" enctype=\"multipart/form-data\"
method=\"post\">
<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"80000\">
<input type=\"file\" name=\"ImageFile\">
<input type=\"submit\" name=\"btnSubmit\" value=\"Upload\">
</form>
";

In the Example_Action.php I have the simple instruction to test the script:

$AppImageDir = "C:\\Inetpub\\wwwroot\\PremoGroup\\Images";

if (isset($_FILES["ImageFile"])) {
move_uploaded_file($_FILES['ImageFile']['tmp_name'],
$AppImageDir."\\".$_FILES['ImageFile']['name']);
}

Note that the double \\ are to escape "" and \\.

I try the script and the following error appears:

Warning: move_uploaded_file(C:\Inetpub\wwwroot\PremoGroup\Images\21532.jpg)
[function.move-uploaded-file]: failed to create stream: Permission denied in
c:\inetpub\wwwroot\Predan\example.php on line 6

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move
'C:\PHP\uploadtemp\php15.tmp' to
'C:\Inetpub\wwwroot\PremoGroup\Images\21532.jpg' in
c:\inetpub\wwwroot\Predan\example.php on line 6

Does somebody know why and how this error is produced and what I need to do
(what to change in the code, where to set what permissions, etc.)?

Thank you very much,
FRANS BAKKER



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to