7

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

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>  

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.

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?

Community
  • 1
  • 1
Kordan Ou
  • 1,502
  • 3
  • 15
  • 25
  • It might be a port forwarding problem. – lazyCrab Jul 17 '13 at 08:58
  • ^ Or a firewall and/or file sharing in windows is disabled – DarkBee Jul 17 '13 at 09:13
  • @lazyCrab Could you describe it in more details?? – Kordan Ou Jul 18 '13 at 02:36
  • @DarkBee The network links work when I visited the website on localhost. I think not the firewall issue and it's certainly shared. – Kordan Ou Jul 18 '13 at 02:40
  • @KordanOu : What are the permisions on the share ? Does everyone have read rights ? (The share permissions, not the NTFS ones) – DarkBee Jul 18 '13 at 06:35
  • @DarkBee he read right is open for all login users. All of them are Windows machines and logged in the remote server sharing the directory. (That means I could get into \\172.21.1.123\DIR directly by Windows explorer) – Kordan Ou Jul 18 '13 at 08:58
  • Seems its more likely a browser security setting: http://stackoverflow.com/questions/192080/firefox-links-to-local-or-network-pages-do-not-work – DarkBee Jul 18 '13 at 09:08
  • @DarkBee Still no luck...:( – Kordan Ou Jul 22 '13 at 08:07
  • I'd say install a webserver on the computer. Create a script that list the contents of the shared folder and output links like : http://X.X.X.X/DIR/file1.rar. Make sure port 80 is not blocked by the firewall of the host computer – DarkBee Jul 22 '13 at 08:12

1 Answers1

1

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.

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.

Enkari
  • 36
  • 3