code:$types = array("image/gif", "image/pjpeg", "image/bmp", "video/mpeg", "video/x-msvideo", "image/png", "application/x-shockwave-flash"); if(in_array($HTTP_POST_FILES['file']['type'], $types)) {