Paul's Programming Notes     Archive     Feed     Github

PHP - Verify File Is Uploaded And Zip


if($_FILES["zip_file"]["name"]) {
     $filename = $_FILES["zip_file"]["name"];


     $name = explode(".", $filename);


     $continue = strtolower(end($name)) == 'zip' ? true : false;
     if(!$continue) {
           $message = "The file you are trying to upload is not a .zip file. Please try again.";
     } else {
          $message = "File Is .zip";
     }
}