I've been looking for a solution for this for a bit... I decided to
just try and copy and paste the solution from php.net to try and still
nothing.
//theUpload.php
<?php
echo"<form enctype=\"multipart/form-data\" action=\"result.php\"
method=\"post\">";
echo" <input type=\"hidden\" name=\"MAX_FILE_SIZE\"
value=\"30000000\" />";
echo" Send this file: <input name=\"userfile\" type=\"file\" />";
echo" <input type=\"submit\" value=\"Send File\" />";
echo"</form>";
?>
//result.php
<?php
$uploaddir = 'Products_images/';
$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";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging
info:\n";
print_r($_FILES);
}
print "</pre>";
?>
this results in the following errors....
Warning: move_uploaded_file(Products_images/aPicture.bmp): failed to
open stream: Permission denied in /home/blah/public_html/result.php on
line 11
Warning: move_uploaded_file(): Unable to move '/tmp/phpDDU9vj' to
'Products_images/aPicture.bmp' in /home/blah/public_html/result.php on
line 11
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => aPicture.bmp
[type] => image/bmp
[tmp_name] => /tmp/phpDDU9vj
[error] => 0
[size] => 230454
)
)
I tried setting the permissions of the Product_images folder to write
for owner and world.. then i tried to do the same for public_html with
no avail.
Any suggestions??
-Jim