在某些机器上的javascript中,文件的MIME类型返回空 [英] MIME type of file returning empty in javascript on some machines

查看:41
本文介绍了在某些机器上的javascript中,文件的MIME类型返回空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个JavaScript代码段,用于检查文件的mime类型.

I have a javascript snippet written which checks for the mime type of the files.

var type = this.files [0] .type;

代码运行了很长时间,但现在却以某种方式无法找到文件类型的值.

Code was running fine for a long time but now somehow its not able to find value of file type.

我检查了浏览器的调试工具,发现文件的mime类型为空.

I checked in browser's debug tool and find mime type of file is blank.

问题仅在某些计算机上发生,而在其他计算机上运行良好,尽管两台计算机都在 Windows 10 上运行并且使用相同版本的 google chrome (版本68.0.3440.84).

Issues is happening on some machines only and running fine on others, although both machines are running on Windows 10 and using same version of google chrome (version 68.0.3440.84).

有什么主意吗?

推荐答案

最后,我得到了我的问题的答案,这就是为什么在某些计算机上发生这种情况的原因.

Finally, i got the answer for my question and here is reason why this was happening on some machines.

正如我所期望的,问题是系统特定的,注册表(HKEY_CLASSES_ROOT.csv)下缺少.csv类型的内容类型.

As i was expecting, issue is system specific where content-type for .csv type is missing under Registry (HKEY_CLASSES_ROOT.csv).

请参阅屏幕截图,某些计算机上缺少此条目.

See screenshot, This entry was missing on some machines.

这篇关于在某些机器上的javascript中,文件的MIME类型返回空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆