Mega Code Archive
PHP Code to Upload files to server
$maxfilesize)
{
$error = "File is too large.";
unlink($HTTP_POST_FILES['file']['tmp_name']);
// assign error message, remove uploaded file, redisplay form.
}
else
{
//File has passed all validation, copy it to the final destination and remove the
temporary file:
copy($HTTP_POST_FILES['file']['tmp_name'],$HTTP_POST_FILES['file']['name']);
unlink($HTTP_POST_FILES['file']['tmp_name']);
print "File has been successfully uploaded!";
exit;
}
}
}
?>