Problem Allowing Image Upload Image/pjpeg On Internet Explorer
- Forums
- PHP
- Problem Allowing Image Upload Image/pjpeg On Internet Explorer
This Page Contains information about Problem Allowing Image Upload Image/pjpeg On Internet Explorer By wallpaperama in category PHP with 1 Replies. [1240], Last Updated: Sat May 18, 2024
wallpaperama
Sat Jan 10, 2009
1 Comments
902 Visits
today i learned something very weird, i have a script where i can upload some image files and the files that are allowed are:
.gif .png .jpeg
when i upload a jpg file with firefox, it works fine, but when i try with internet explorer it doesnt work doesnt recognice none of the formats of the file extensions
so to troubleshoot the problem i wanted to see what type of file was i uploading. and when i print out the value it said: image/pjpeg instead of image/jpeg
IE for some reason add an extra p at the front of jpeg
so after i added the .pjpeg extension it worked.
if($_FILES['upload']['type']=="image/pjpeg"){ echo 'this is allowed';}
so if you also are having a image/pjpeg problem with EI, you can fix it by allowing pjpeg files on your uploads so it wont error out when someone or you tries to upload a picture or image file check file type with this little code i put at the top. hope that helps
worked like a charm. why oh why are the bulk of my problems ie7 related?