简体   繁体   English

上载图片mime类型的应用程序/ jpg

[英]Uploading image mime-type application/jpg

We have a few pcs in the office and while testing a websites image uploading in one of them the mime-type detected was "application/jpg" or "application/png" while it should be "image/jpg" and "image/png". 我们办公室里有几台电脑,在测试网站图像上传时,其中一个检测到的MIME类型是“ application / jpg”或“ application / png”,而它应该是“ image / jpg”和“ image / png” ”。 The browsers that did this were Internet explorer v11.0 and Edge v40. 做到这一点的浏览器是Internet Explorer v11.0和Edge v40。 The versions were same on other pc but the mime-types were ok (image/ ). 其他PC上的版本相同,但mime类型还可以(图片/ )。 Where is it getting the idea that image mime-type is application/ ?? 图像mime类型是application /的想法在哪里

The upload element is nothing special (it is triggered by an outside button): upload元素没什么特别的(它由一个外部按钮触发):

<input style="display:none" id="upload_damage_image" type="file" name="file[0]">

We had this issue recently, the cause was Autodesk Pixlr it had overwritten the String value Content Type from "image/jpeg" to "application/jpeg" in registry HKLM\\SOFTWARE\\Classes.jpg. 我们最近遇到了此问题,原因是Autodesk Pixlr,它已将注册表HKLM \\ SOFTWARE \\ Classes.jpg中的字符串值Content Type从“ image / jpeg”覆盖为“ application / jpeg”。

Uninstalled Autodesk Pixlr but it actually deleted the Content Type values rather than restoring to image/*. 卸载了Autodesk Pixlr,但实际上删除了“内容类型”值,而不是还原为image / *。

Used Regshot to compare registry before and after installation of Autodesk Pixlr. 使用Regshot在安装Autodesk Pixlr之前和之后比较注册表。 Identified the changed entries below: 标识了以下更改的条目:

HKLM\\SOFTWARE\\Classes.bmp\\Content Type: "application/bmp" HKLM\\SOFTWARE\\Classes.gif\\Content Type: "application/gif" HKLM\\SOFTWARE\\Classes.jpeg\\Content Type: "application/jpeg" HKLM\\SOFTWARE\\Classes.jpg\\Content Type: "application/jpg" HKLM\\SOFTWARE\\Classes.png\\Content Type: "application/png" HKLM\\SOFTWARE\\Classes.tif\\Content Type: "application/tif" HKLM\\SOFTWARE\\Classes.tiff\\Content Type: "application/tiff" HKLM \\ SOFTWARE \\ Classes.bmp \\内容类型:“ application / bmp” HKLM \\ SOFTWARE \\ Classes.gif \\内容类型:“ application / gif” HKLM \\ SOFTWARE \\ Classes.jpeg \\内容类型:“ application / jpeg” HKLM \\ SOFTWARE \\ Classes.jpg \\ Content类型:“应用程序/ jpg” HKLM \\ SOFTWARE \\ Classes.png \\内容类型:“ application / png” HKLM \\ SOFTWARE \\ Classes.tif \\内容类型:“ application / tif” HKLM \\ SOFTWARE \\ Classes.tiff \\ Content类型:“应用程序/ tiff”

So uninstalled it again, backed up registry and created the correct entries below: 因此,再次将其卸载,备份注册表并在下面创建正确的条目:

HKLM\\SOFTWARE\\Classes.bmp\\Content Type: "image/bmp" HKLM\\SOFTWARE\\Classes.gif\\Content Type: "image/gif" HKLM\\SOFTWARE\\Classes.jpeg\\Content Type: "image/jpeg" HKLM\\SOFTWARE\\Classes.jpg\\Content Type: "image/jpeg" HKLM\\SOFTWARE\\Classes.png\\Content Type: "image/png" HKLM\\SOFTWARE\\Classes.tif\\Content Type: "image/tiff" HKLM \\ SOFTWARE \\ Classes.bmp \\内容类型:“ image / bmp” HKLM \\ SOFTWARE \\ Classes.gif \\ Content类型:“ image / gif” HKLM \\ SOFTWARE \\ Classes.jpeg \\内容类型:“ image / jpeg” HKLM \\ SOFTWARE \\ Classes.jpg \\ Content类型:“ image / jpeg” HKLM \\ SOFTWARE \\ Classes.png \\ Content类型:“ image / png” HKLM \\ SOFTWARE \\ Classes.tif \\ Content类型:“ image / tiff”
HKLM\\SOFTWARE\\Classes.tiff\\Content Type: "image/tiff" HKLM \\ SOFTWARE \\ Classes.tiff \\ Content类型:“图像/ tiff”

This resolved the issue. 这解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM