1/*
2 =============Input Type File=============
3 other inputs can be easly validated using the HTML required attr or using
4 php empty() function
5*/
6$is_uploading = $_FILES["inputfilename"]["error"];
7/*
8 the variable $is_uploading has value either 0 or 4
9 0 => the user is uploading specific files or images
10 4 => user is not uploading anything
11*/
12$can_pass = $is_uploading == 0 ? true : false;
13if($can_pass){
14 echo "You can Pass";
15}
16else{
17 echo "Please upload. Your request has empty files.";
18}
1if ($_FILES['cover_image']['size'] == 0 && $_FILES['cover_image']['error'] == 0)
2{
3 // cover_image is empty (and not an error)
4}