如何让 File:// 协议在 IE8 中工作?
我正在本地计算机上运行一个网站(“http://localhost/asdf”)并尝试获取一些文件:// 工作协议链接。实际上,我正在尝试打开一个文件夹,而不是一个特定的文件,但我无法让它们工作。
我已经将 localhost 放在我的“受信任区域”中,我尝试了“文件”、“:”、一些“/”的每个组合,然后是一大堆不同的路径,但编码和未编码。
当我点击链接时,我所做的任何事情都不会导致任何内容打开。如果我复制链接目标并将其粘贴到浏览器地址窗口中,那么它就会按预期工作。
有人知道其中的秘密吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在“安全”选项卡的“Intranet 区域”中添加您的 Intranet 站点。
Add your intranet site in the Intranet Zone in Security Tab.
一般来说,
file:///
URL 不适用于通过 HTTP 下载的页面,它们有时可以在 IE7 及更早版本中工作,这是一个安全问题。Generally
file:///
URLs shouldn't work on pages downloaded via HTTP, that they sometimes work in IE7 and earlier is a security issue.我们发现
window.open
方法在 URL 中使用文件协议会导致该方法失败。在 IE 下,行为不稳定。在某些情况下,会打开 URL 中提到的对象,但不会创建窗口对象实例。在其他情况下,URL 无法打开。在某些情况下,我们注意到在 Windows 7 下,该 URL 会打开,而在 XP 下则不会。在 Safari、Chrome 和 Firefox 下,该 URL 从未打开。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.本地服务器与 file:// 不同,它应该在 IE 中正常工作。但是,如果您可能想查看 apache 别名 并链接该链接文件夹到您的服务器。顺便说一句,无论如何你都不应该使用文件协议,它在生产中不起作用。
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.