How do you get the File:// protocol to work in IE8?

血红的双手。 提交于 2019-12-13 01:23:23

问题


I am running a website on my local machine ("http://localhost/asdf") and trying to get some file:// protocol links to work. In reality I'm trying to open a folder, not a specific file, but I can't get either to work.

I've put localhost in my "trusted zone", I've tried every combo of "file" ,":", some number of "/" and then a whole bunch of different paths, but encoded and not encoded.

Nothing I do causes anything to open when I click on the link. If I copy the link destination, and paste that in the browser address window, then it works as expected.

Anyone know the secret?


回答1:


Add your intranet site in the Intranet Zone in Security Tab.




回答2:


Generally file:/// URLs shouldn't work on pages downloaded via HTTP, that they sometimes work in IE7 and earlier is a security issue.




回答3:


We found that window.open method using the file protocol in the URL causes the method to fail. Under I.E. the behavior is erratic. In some instances, the object mentioned in the URL is opened but the window object instance is not created. In others, the URL failes to open. In some instances we noted that under Windows 7, the URL opens, under XP it does not. Under Safari,Chrome and Firefox, the URL never opened.




回答4:


Local server is something different than just file://, that should work in IE as it is. However, if you probably want to check out apache alias and link that folder to your server. Btw, you should not use file protocol anyway, it will not work on production.



来源:https://stackoverflow.com/questions/2762819/how-do-you-get-the-file-protocol-to-work-in-ie8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!