HTML links to local network shares [duplicate]

2019-01-25 05:51发布

This question already has an answer here:

Why do these links not work? If I click on them in FF or Chrome, nothing happens - it doesn't even try to open them!

<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?

3条回答
Ridiculous、
2楼-- · 2019-01-25 06:46

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.

查看更多
3楼-- · 2019-01-25 06:50

Peter's got the answer, but FYI you should find something like the following in FF's Error Console (available from the Tools menu):

Security Error: Content at http://localhost/temp/a.html may not load or link to file:///C:/Documents%20and%20Settings/zzzzzzzz/My%20Documents/www/temp/box.html.

查看更多
疯言疯语
4楼-- · 2019-01-25 06:53

This is an oldie, but goodie -- still comes up quite often.

There are extensions for both browsers (FireFox & Chrome) that can allow you to access local links:

Chrome - Locallink

Firefox - LocalLink

查看更多
登录 后发表回答