In the receiving file upload form, change source filename to lowercase then check extensions.
1 2 3 4 5 6 7 8 9 10 11 12 |
$uploadimage = $_FILES['userfile']['name']; $upload_image = strtolower($upload_image); $allowed = array('gif','png' ,'jpg'); $ext = pathinfo($upload_image, PATHINFO_EXTENSION); if(!in_array($ext,$allowed) ) { // echo 'error'; die("Nope!"); } |