在 html 页面上链接 UNC/网络驱动器 [英] Linking a UNC / Network drive on an html page

查看:23
本文介绍了在 html 页面上链接 UNC/网络驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是一个基本的 html 链接问题.

Just a basic html link question.

我有一个内部网设置,我需要链接到一些网络驱动器.它们位于诸如 server_drivelahblahdoc.docx

I have an intranet setup, and I need to link to some network drives. They are located on drives such as server_drivelahblahdoc.docx

使用 file://不适用于 IE8 或 Firefox.如何链接到这些文件?

Using file:// does not work on either IE8 or Firefox. How can I link to these files?

推荐答案

要从 HTML 文档链接到 UNC 路径,请使用 file://///(是的,这是五个斜线).

To link to a UNC path from an HTML document, use file:///// (yes, that's five slashes).

file://///server/path/to/file.txt

file://///server/path/to/file.txt

请注意,这在 IE 和 Outlook/Word 中最有用.它不会在 Chrome 或 Firefox 中故意工作 - 链接将无提示地失败.Mozilla 团队的一些话:

Note that this is most useful in IE and Outlook/Word. It won't work in Chrome or Firefox, intentionally - the link will fail silently. Some words from the Mozilla team:

出于安全考虑,Mozilla应用程序阻止链接到本地来自远程的文件(和目录)文件.

For security purposes, Mozilla applications block links to local files (and directories) from remote files.

不那么直接,来自 Google:

Firefox 和 Chrome 不会打开来自本地机器外部的页面的file://"链接.这是这些浏览器为提高安全性而做出的设计决策.

Firefox and Chrome doesn't open "file://" links from pages that originated from outside the local machine. This is a design decision made by those browsers to improve security.

Mozilla 文章包含一组客户端设置,您可以使用它来覆盖 Firefox 中的此行为,并且还有用于 两者 浏览器覆盖这个限制.

The Mozilla article includes a set of client settings you can use to override this behavior in Firefox, and there are extensions for both browsers to override this restriction.

这篇关于在 html 页面上链接 UNC/网络驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆