I have image upload website. Someone is uploading here shells files. My validations are: - Check file's mime (only image's mimes able) - Check if getimagesize returning array (by is_array) If not, error. And still, Someone is uploading shells files. Please help. Thnkas alot!
Little check:
$ext = ($_FILES['files']['type']); if (($ext != "image/jpeg") && ($ext != "image/pjpeg") && ($ext !="image/png") && ($ext != "image/gif") && ($ext != "image/bmp") && ($ext != "image/x-icon") && (!is_array(getimagesize($_FILES['files']['tmp_name'])))) { // Show error } else { // Keep upload... } 