Hi, I need a PHP script that excludes images sent from a form that aren't JPEGs. I originally tried this PHP script: [code=php:0] <?php $target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']); $ok=1; if ($uploaded_type != 'image/jpeg') { { echo "Sorry your file needs to be a JPEG image."; $ok=0; } if ($ok==0) { echo "Sorry your file was not uploaded"; } else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], 'images/title.jpg')) { echo "Your image has been uploaded."; } else { echo "Sorry, there was a problem uploading your file."; } ?> [/code] This script worked perfectly on most computers, but on those that hide file extensions it rejected even valid JPEG images. I tried the getimagesize() method below too as an alternative means of rejecting non JPEG files. It doesn't work either, can you help? Thanks – Leao [code=php:0] <?php $target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']); $ok=1; list($ImportWidth,$ImportHeight,$ImageMimeType) = getimagesize($_FILES['uploaded']['tmp_name']) ; if ($ImportMimeType != 'image/jpeg') { echo "Sorry your file needs to be a JPEG image."; $ok=0; } if ($ok==0) { echo "Sorry your file was not uploaded"; } else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], 'images/title.jpg')) { echo "Your image has been uploaded."; } else { echo "Sorry, there was a problem uploading your file."; } ?> [/code]