You must try to upload the file again!
";
unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
}
//this will check the size and make sure it is not bigger than $maxsize
if($HTTP_POST_FILES['upload_file']['size'] > $maxsize AND !isset($error)) {
$error = "Error, file must be less than $maxsize bytes.
";
unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
}
//this will check to make sure the file is only a .txt file
if($HTTP_POST_FILES['upload_file']['type'] != "text/txt" AND !isset($error)) {
$error = "You may only upload .txt files.
";
unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
}
//the uploaded file has passed all checks, we will now proceed to mv the file on
//it will copy it from a /tmp folder to the /var/ww/html/uploads/ dir
if (!isset($error)) {
copy($HTTP_POST_FILES['upload_file']['tmp_name'],"/var/www/html/uploads/".$HTTP_POST_FILES
['upload_file']['name']);
unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
print "Thank you for your upload.";
exit;
}
else
{
echo ("$error");
}
?>