File:// link doing nothing in all browsers

▼魔方 西西 提交于 2019-12-23 21:48:56

问题


I have a link being generated that looks like so:

<a target="_blank" title="Test" href="file:///c:/test.xls">Test</a>

This link is inside an iframe.

When I click on it (in any major browser), nothing happens. Fiddler records no traffic. Pasting the URL into the nav bar works fine - the file download box comes up, and I can download the file no problem.

I've tried every variant of the URL structure (correct and incorrect, colons, slashes, backslashes, etc.) that I can think of.

I'm certain that it's some kind of security restriction, but I can't for the life of me find out what it is or how to get around it. I'm feeling pretty foolish at this point. Any simple explanations?


回答1:


Sorry, if you are pulling this page off of a server (acessing it as http://), the security settings won't let you link to local content (acess links as file://). I've had this same problem accessing shared .doc files in a wiki. Never came up with a good solution.




回答2:


Try a colon instead of a pipe ;)



来源:https://stackoverflow.com/questions/1257792/file-link-doing-nothing-in-all-browsers

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