problem for my uploading file script
hi i got a problem with my uploading script
here is the code on the page which shows the upload button.
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="90000000" />
Choose a file to upload: <input name="uploadfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
here is the code taken from php.net, it's in upload.php
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = "/website_root/color_scripts/querypic.jpg";
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
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>";
?>
upon uploading i get the following error
Possible file upload attack!
Here is some more debugging info:Array
(
[uploadfile] => Array
(
[name] => querypic.jpg
[type] => image/pjpeg
[tmp_name] => d:\Program Files\xampp\tmp\phpBB.tmp
[error] => 0
[size] => 30489
)
)
can anyone please help?