Hi there,
I'm trying to upload a file, and the following code works on windows xp, but in win2k server doesn't work.
The code is the following:
$uploadDir = 'd:/Inetpub/
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
$myFile = $_FILES['userfile']['name'];
$myFile .= " es mi archivo";
print $myFile;
print "<br>";
print $myName;
print "<br>";
print_r($_FILES);
}
else
{
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
The error message that I'm getting is the following:
Warning: move_uploaded_file(d:/Inetpub/ failed to open stream: Permission denied in d:\inetpub\ on line 16
Warning: move_uploaded_file(): Unable to move 'D:\PHP\uploadtemp\php3C.tmp' to 'd:/Inetpub/ in d:\inetpub\ on line 16
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => pagerror.gif
[type] => image/bmp
[tmp_name] => D:\PHP\uploadtemp\php3C.tmp
[error] => 0
[size] => 2806
)
)
Thank you guys for your help!!
Dr. Stern
I'm trying to upload a file, and the following code works on windows xp, but in win2k server doesn't work.
The code is the following:
$uploadDir = 'd:/Inetpub/
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print "<pre>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\n";
$myFile = $_FILES['userfile']['name'];
$myFile .= " es mi archivo";
print $myFile;
print "<br>";
print $myName;
print "<br>";
print_r($_FILES);
}
else
{
print "Possible file upload attack! Here's some debugging info:\n";
print_r($_FILES);
}
The error message that I'm getting is the following:
Warning: move_uploaded_file(d:/Inetpub/ failed to open stream: Permission denied in d:\inetpub\ on line 16
Warning: move_uploaded_file(): Unable to move 'D:\PHP\uploadtemp\php3C.tmp' to 'd:/Inetpub/ in d:\inetpub\ on line 16
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => pagerror.gif
[type] => image/bmp
[tmp_name] => D:\PHP\uploadtemp\php3C.tmp
[error] => 0
[size] => 2806
)
)
Thank you guys for your help!!
Dr. Stern