在浏览器中强制使用Mime类型(使用Javascript) [英] Force Mime Type in Browser (with Javascript)
问题描述
[我想出于安全考虑,这是不可能的,但是:]
[I imagine that this is impossible due to security concerns, but:]
是否可以强制浏览器在不控制服务器的情况下处理具有
Is it possible to force the browser to handle a file with a certain mime type without controlling the server? I'm serving up files from file:// (on the client's machine itself) and I'd like to get text files to open in whatever their associated text editor is.
注意:Firefox仅打开文件进行查看,这不是所需的行为.我尝试将文件扩展名更改为未知的文件,但这无济于事.
Note: Firefox just opens the file for viewing, which is not the desired behavior. I've tried changing the file extension even to something unknown, which does not help.
推荐答案
不,这是不可能的,除非使用IE和ActiveX,但我强烈建议您不要使用它.
Nope, this is impossible, except maybe with IE and an ActiveX, but I seriously suggest you not to use it.
这篇关于在浏览器中强制使用Mime类型(使用Javascript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!