$tmpfile = $_FILES['file']['tmp_name'][$fileid]; if ($tmpfile) { $info = getimagesize($tmpfile); $ftype = $info['mime']; // Check File Image Type if ($ftype != "image/gif" && $ftype != "image/jpeg") { $error = "File type not supported"; $problem = TRUE; }