I use an html form with the proper attributes
and I call the following php code:
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'].".";
}
}
Everything is perfect when I upload txt files. It is impossible binary files to be uploaded.
Is there anything that must be set? According to the manual both ASCII and binary files are uploaded.
Any idea??