I'm trying to do an image upload using the code from php.net
I'm getting the "possible file upload attacj" error message but it doesn't tell me why, can anyone tell me what it means and how I can solve this.
Also do I have to put the full directory path in i.e. c:\inetpub....\site\images and could that be what the problem is?
Code:
<?
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = '/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 $uploaddir;
}
print "</pre>";
?>
I'm getting the "possible file upload attacj" error message but it doesn't tell me why, can anyone tell me what it means and how I can solve this.
Also do I have to put the full directory path in i.e. c:\inetpub....\site\images and could that be what the problem is?