如何创建共享网络目录或文件的超链接? [英] How to create a hyperlink to shared network directory or file?
问题描述
我检查了以下两个相关讨论:
1. 如何制作超级链接到本地可执行文件?
2. Windows共享文件夹的URL
3. Chrome中意外的文件Url跨域问题
4. Firefox链接到本地或网络页面不起作用
I've checked the following two related discussions:
1. How do I make a hyperlink to a local executable?
2. An URL to a Windows shared folder
3. File Url Cross Domain Issue in Chrome- Unexpected
4. Firefox Links to local or network pages do not work
以下链接在我访问localhost上的网站时起作用。也就是说, http:// localhost
。 $ b
The following links work when I visited the website on localhost. That is, http://localhost
.
<a href="\\172.21.1.123\DIR">A Shared Network Directory</a>
<a href="file://172.21.1.123\DIR">A Shared Network Directory</a>
<a href="file://///172.21.1.123\DIR">A Shared Network Directory</a>
但是当我使用访问http://172.21.1.123
,以上所有链接都没有回应。
调试控制台显示不允许加载本地资源:file://172.21.1.123/DIR
。
But when I visited with http://172.21.1.123
, all of above links have no response.
The debug console shows that Not allowed to load local resource: file://172.21.1.123/DIR
.
测试环境(两者都有相同的结果):
- Chrome 28.0.1500
- IE 10
Test Environment (Both of them have the same result.):
- Chrome 28.0.1500
- IE 10
如果是由于安全原因,要关闭任何配置?或者有什么想法?
If it is due to the security reason, any configuration to turn off? Or any idea?
推荐答案
您无法链接到外部/托管/活动网站的网络共享的原因是由于最新的安全功能浏览器如Firefox。
The reason that you cannot link to a network share from an external/hosted/live site is because of security features of latest browsers like Firefox.
您只能从本地HTML文档打开本地网络共享。
You can only open local network shares from a local HTML document.
唯一方法围绕这是安装一个插件为您的浏览器,删除或禁用此安全功能,据我所知。
The only way around this is to install a plugin for your browser that removes or disables this security feature as far as I know.
这篇关于如何创建共享网络目录或文件的超链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!