PHP Upload File Validation
I am creating file upload script and I'm looking for the best techniques and practices to validate uploaded files. Allowed extensions are: $allowed_extensions = array('gif','jpg','png','swf','doc','docx','pdf','zip','rar','rtf','psd'); Here's the list of what I'm doing. Checking file extension $path_info = pathinfo($filename); if( !in_array($path_info['extension'], $allowed_extensions) ) { die('File #'.$i.': Incorrent file extension.'); } Checking file mime type $allowed_mimes = array('image/jpeg','image/png','image/gif','text/richtext','multipart/x-zip','application/x-shockwave-flash',