Showing posts with label internet explorer. Show all posts
Showing posts with label internet explorer. Show all posts

Friday, February 26, 2010

Lại là IE


Share/Bookmark
Data return from uploaded image with some kind of browsers!

Firefox

Array
(
[name] => 7687.png
[type] => image/png
[tmp_name] => D:\xampp\tmp\phpB07.tmp
[error] => 0
[size] => 14618

)


IE 8

Array
(
[name] => 7687.png
[type] => image/x-png
[tmp_name] => D:\xampp\tmp\phpA7E.tmp
[error] => 0
[size] => 14618
)

IE6

Array (
[name] => 7687.png
[type] => image/x-png
[tmp_name] => D:\xampp\tmp\phpB05.tmp
[error] => 0 [size] => 14618
)

Chrome

Array (
[name] => 7687.png
[type] => image/png
[tmp_name] => D:\xampp\tmp\phpA81.tmp
[error] => 0 [size] => 14618
)

Opera

Array (
[name] => 7687.png
[type] => image/png
[tmp_name] => D:\xampp\tmp\phpAE7.tmp
[error] => 0 [size] => 14618
)

Safari

Array
(
[name] => 7687.png
[type] => image/png
[tmp_name] => D:\xampp\tmp\phpB11.tmp
[error] => 0 [size] => 14618
)

So sánh mấy mảng trả về từ form upload cái ảnh png, ông IE nhà ta chơi 1 mình một MIME =)) check vỡ mẹt :|

Wednesday, July 22, 2009

Internet Explorer SUCKS


Share/Bookmark
I've just finished my project, it had multi file upload feature. And there were some problems.

First I used muti file upload from Fyneworks.
It's good.

The trouble came when I validate mime type of uploaded-file.
First I collected a list of mime type, you can search it from internet. And below is the list mime type that I used to validate uploaded-file:

$allow_file = array('gif','jpg','png','doc','docx','rar','zip','wma','mp3','pdf');
$allow_mime = array(
'image/gif', 'image/jpeg', 'image/png',
'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/x-rar-compressed', 'application/zip',
'application/octet-stream','application/force-download','image/pjpeg', //fix for suck mime of ie *_*
'audio/mpeg', 'audio/x-ms-wma',
'application/pdf'
);


zip application/zip
doc application/msword
docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
jpeg image/jpeg
jpg image/jpeg
doc application/msword
mp3 audio/mpeg3
rar application/x-rar-compressed

When validate in client by javascript, it's ok.
But when validate by php, the trouble come!!!
In Firefox the mime type of uploaded-file is true.
But when i use Internet Explorer v6 to submit file, some file is missing.
What's the f*ck!ng ???
Hum,....
I've used the print_r to debug, it's really good at this instance.

Let's see:
In Firefox : All mime type are right!!!
ex:
rar => application/x-rar-compressed
zip => application/zip
and
jpeg => image/jpeg
But in Internet Explorer:
rar => application/force-download
zip => application/octet-stream
and
jpeg => image/pjpeg
I have not tested all the mime type, but now I know the reason of missing file.
:D