为什么IE7指定mime类型的image / pjpeg而不仅仅是image / jpeg?

时间:2023-02-08 21:16:04

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?

当通过IE7中的表单上传文件(jpeg)时,我看到的是mime类型的“image / pjpeg”而不是“image / jpeg”(正如我在Firefox或类似网站中看到的那样)。解决这个问题很容易,但我只是想知道为什么IE7在这种情况下表现不同?

4 个解决方案

#1


36  

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

我相信这是因为您正在使用的JPEG是渐进式JPEG,它具有不同的mime类型。

#2


27  

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

IE可以将所有.jpeg文件作为其hack MIME类型'image / pjpeg'上传,无论它们是否真的是渐进式的。

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.

不要依赖文件上传中提供的MIME类型,因为包括这个原因在内的各种原因都有可能出错。

#3


24  

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

因为微软喜欢违反标准。没有像image / pjpeg这样的MIME类型。亲眼看看:http://www.iana.org/assignments/media-types/media-types.xhtml#image

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

JPEG的正确MIME类型是image / jpeg,是否为progressive。

#4


16  

There is same problem with png:

png也有同样的问题:

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

IE7:image / x-png普通浏览器:image / png

;)

#1


36  

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

我相信这是因为您正在使用的JPEG是渐进式JPEG,它具有不同的mime类型。

#2


27  

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

IE可以将所有.jpeg文件作为其hack MIME类型'image / pjpeg'上传,无论它们是否真的是渐进式的。

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.

不要依赖文件上传中提供的MIME类型,因为包括这个原因在内的各种原因都有可能出错。

#3


24  

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

因为微软喜欢违反标准。没有像image / pjpeg这样的MIME类型。亲眼看看:http://www.iana.org/assignments/media-types/media-types.xhtml#image

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

JPEG的正确MIME类型是image / jpeg,是否为progressive。

#4


16  

There is same problem with png:

png也有同样的问题:

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

IE7:image / x-png普通浏览器:image / png

;)