//This is our size condition if ($uploaded_size > 1024) { echo "Your file is too large.
"; $ok=0; } $fileext = file_extension($_FILES['uploaded']['name']); $fileexto = strtoupper($fileext); echo '|'.$fileexto.'|'; $exclude = array('ZIP' , 'RAR' , 'GIF' , 'PNG' , 'JPG' , 'BMP' , 'TXT' , 'HTM' , 'HTML' , 'VTF' , 'VMT' , 'EXE' , 'DLL' , 'CFG'); if (in_array($filexto, $exclude)) { } else { die(' YOU TRIED TO UPLOAD A FILE WHICH IS NOT ALLOWED'); }