From the manual
<form enctype="multipart/form-data" action="URL" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
<?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
// In PHP earlier then 4.0.3, use copy() and is_uploaded_file() instead of move_uploaded_file
$uploaddir = '/var/www/uploads/'; // change this to your location to save the file.
print "<pre>";
if (move_uploaded_file($FILES['userfile']['tmp_name'], $uploaddir . $FILES['userfile']['name'])) {
print "File is valid, and was successfully uploaded. 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);
}
?>
HalfaBee