Learning PHP and MySQL
Example 11-25 Checking for the existence of an uploaded file
<?php
if (!is_uploaded_file($HTTP_POST_FILES['upload_file']['tmp_name'])) {
$error = "You must upload a file!";
unlink($HTTP_POST_FILES['upload_file']['tmp_name']);
} else {
//proceed to process the file
}
?>
Posted by on 08/19 at 08:43 AM
Next entry: Example 11-26 Checking the file size
Previous entry: Example 11-24 Prompting to upload a file