That's a sample code...
You must be able to upload both ASCII and binary files according to the manual.
I have only tried to upload txt files.
If you managed to do both please let me know.
<body>
<form enctype="multipart/form-data" action="action.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <input name="userfile" type="file" >
<input type="submit" value="Send File">
</form>
In the action.php you will write the following function and you will call it...
function handleupload() {
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
$filename = $_FILES['userfile']['tmp_name'];
print "$filename was uploaded successfully. ";
$realname = $_FILES['userfile']['name'];
print "realname is $realname";
print "copying file to uploads dir... ";
copy($_FILES['userfile']['tmp_name'],"/home/adamop/public_html/test/uploads/".$realname);
} else {
echo "Possible file uploadattack: filename ".$_FILES['userfile']['name'].".";
}
}
If anything goes wrong just tell me..
bye