views:

4380

answers:

5

When uploading a file (jpeg) via a form in IE7 I am seeing a mime-type of "image/pjpeg" instead of "image/jpeg" (as I see in Firefox or similar). It's easy enough to work around this problem, but I'm just wondering why IE7 is behaving differently in this case?

+6  A: 

I believe it's because the JPEG you're working with is a progressive JPEG, which has a different mime-type.

Pseudo Masochist
Are there several mime types which would be correct?
Liam
I think it's just image/jpeg and image/pjpeg (for JPEGs). I'm not even sure if using a mime of "image/pjpeg" is even standard, but when has that stopped anyone? :)
Pseudo Masochist
Is there any reason why IE7 makes this distinction though - whereas FF etc doesn't?
John Montgomery
Apparently the IE team thought it was different enough to call out with a separate mime type. But they were probably wrong in doing so:http://groups.google.com/group/comp.infosystems.www.authoring.images/msg/7706603e4bd1d9d4?hl=en
Pseudo Masochist
Ah, so it's because (historically) image/jpeg as a mime-type was around before progressive JPEGs themselves, so not all browsers that said they could accept image/jpeg could deal with progressive JPEGs.
John Montgomery
+6  A: 

IE can upload all .jpeg files as its hack MIME type 'image/pjpeg' regardless of whether or not they're actually progressive.

Don't rely on the MIME type supplied in a file upload, there is every chance it could be wrong for a variety of reasons including this one.

bobince
Another stackoverflow.com question/answer concerning the same:http://stackoverflow.com/questions/200912/what-is-the-difference-between-image-x-citrix-pjpeg-and-image-pjpeg
Jacco
+3  A: 

There is same problem with png:

IE7: image/x-png Normal browsers: image/png

;)

That's slightly different: the x- prefix is standardised as a namespace for unregistered MIME types, so this isn't violating the standard. But still, it ought to use image/png.
Stewart
+3  A: 

Because M$ likes to violate standards. There's no such MIME type as image/pjpeg. See for yourself: http://www.iana.org/assignments/media-types/image/

The correct MIME type for JPEG is image/jpeg, progressive or not.

Stewart
A: 

It's simple. Internet Explorer is getting to be something but not a standard Browser no more. The best ones became Firefox, Opera ...

People must just stop seeing it as a standard Browser now and know they could get problems using it, then they should start to avoid it from the start caus Microsoft is really surprising in a no good way.
Caus who really need those changes that ennoying Developpers and making things so complicated?

Jacksy
You registered just to spout out this garbage???
Charles Boyung