File upload reception desk
\n";
$file = $_FILES['mugshot'];
// print "Max size: ".$_POST["MAX_FILE_SIZE"];
// print "File error code: ".$file['error'];
if ($file['size'] > $_POST["MAX_FILE_SIZE"] || $file['size'] < 100)
die ("File too large (or small)\n");
// ---- file has arrived in temporary location
// virus scan
exec("clamscan ".$file['tmp_name'], $output, $result);
if ($result !== 0) die("Bad file!!");
// now safe, move to desired location, such as
$filename = $file['name'];
if (!move_uploaded_file($file['tmp_name'],"upload/$filename"))
die ('Possible attack! File: ' . $file['name']."\n") ;
//----- File is now uploaded
$subject = str_replace("\n",'',$_POST['subject']);
?>
Another file upload -or-
Revisit See Files