I have used the code exactly as in the manual
HTML
<form enctype="multipart/form-data" action="upload.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="300000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" size="20" />
<input type="submit" value="Send File" />
</form>
php
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = './';
$uploadfile = $uploaddir . basename($HTTP_POST_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($HTTP_POST_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($HTTP_POST_FILES);
print "</pre>";
?>
Debugging info
Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => Training.html
[type] => text/html
[tmp_name] => /tmp/phphKvCry
[error] => 0
[size] => 18180
)
)
It's still not working. Please can anybody help me with this problem