Answers for "php check if input file is empty"

PHP
1

php check if input type file is emty

/*
  =============Input Type File=============
*/
$is_uploading = $_FILES["inputfilename"]["error"];
/*
  the variable $is_uploading has value either 0 or 4
  0 => the user is uploading specific files or images
  4 => user is not uploading anything
*/
$can_pass = $is_uploading == 0 ? true : false;
if($can_pass){
  echo "You can Pass";
}
else{
  echo "Please upload. Your request has empty files.";
}
Posted by: Guest on June-12-2021
0

php check if post file is empty

if ($_FILES['cover_image']['size'] == 0 && $_FILES['cover_image']['error'] == 0)
{
    // cover_image is empty (and not an error)
}
Posted by: Guest on May-14-2020

Code answers related to "php check if input file is empty"

Browse Popular Code Answers by Language