Answers for "php check if input type 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

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

Browse Popular Code Answers by Language