File Upload
Posted: Sat Nov 04, 2006 10:57 am
I am using this code:
And getting this:
Can anyone help... I've been trying for ever.
Code: Select all
<?php
$uploaddir = 'images/';
$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>";
?>And I can't figure out why!File is valid, and was successfully uploaded.
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => untitled.JPG
[type] => image/pjpeg
[tmp_name] => /var/tmp/phpoy40P1
[error] => 0
[size] => 4354
)
)
Can anyone help... I've been trying for ever.