简体   繁体   中英

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.

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,但我认真建议你不要使用它。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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