本地网络共享的 HTML 链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1465010/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
HTML links to local network shares
提问by joshcomley
Why do these links not work? If I click on them in FF or Chrome, nothing happens - it doesn't even tryto open them!
为什么这些链接不起作用?如果我在 FF 或 Chrome 中单击它们,则什么也不会发生 - 它甚至不会尝试打开它们!
<a href="file://someshare/dir/subdir/file.txt">Linky</a>
<a href="file:////someshare/dir/subdir/file.txt"> Linky</a>
<a href="file://\someshare\dir\subdir\file.txt">Linky</a>
Any ideas?
有任何想法吗?
采纳答案by Peter
In general, this is disabled because it is a security risk. See also this question: Cross-browser link to file on local system, and the link provided by sleske to here.
通常,这是禁用的,因为它存在安全风险。另请参阅此问题: 跨浏览器链接到本地系统上的文件,以及 sleske 提供的链接到此处。
回答by Sean O
回答by NickFitz
Peter's got the answer, but FYI you should find something like the following in FF's Error Console (available from the Tools menu):
彼得得到了答案,但仅供参考,您应该在 FF 的错误控制台(可从“工具”菜单中找到)中找到类似以下内容:
Security Error: Content at http://localhost/temp/a.htmlmay not load or link to file:///C:/Documents%20and%20Settings/zzzzzzzz/My%20Documents/www/temp/box.html.
安全错误:http://localhost/temp/a.html 上的内容可能无法加载或链接到 file:///C:/Documents%20and%20Settings/zzzzzzzz/My%20Documents/www/temp/box.html。