Im trying to optimize my photo-uploader, so that it'll allow all file-extensions, including uppercase .JPG/.JPEG or .PNG
I've been trying to put strtolower() on the $extension variable, with no luck. And many other solutions, nothing helps. Here's where i filter extension names:
Just installed the exif and mbstrings .dll .. Now i got this error:
"exif_imagetype() filename cannot be empty"
// FILE EXTENSION FILTER
$allowed_types = array(IMAGETYPE_GIF,IMAGETYPE_JPEG,IMAGETYPE_PNG);
if(in_array(exif_imagetype($_FILES["uploaded_file"]["tmp_name"]), $allowed_types)){
// SUCCSESFUL
Any help is much apreaciated! ive been trying to make this work for hours now :D
pathinfo()
:pathinfo($_FILES['uploaded_file']['name'], PATHINFO_EXTENSION)
. - George Brighton