Usually code is if ($_FILES[‘input_field_name’][‘type’] == ‘image/jpeg’) { //some code } but it is not fully validating the file types(mime). The following code will output the correct file type and avoids the security vulnerabilities of php. $phpfileInfo = new finfo(FILEINFO_MIME_TYPE); $PhpfileContents = file_get_contents($_FILES[‘name_of_input_field’][‘tmp_name’]); $MimeFileType = $phpfileInfo->buffer(PhpfileContents);