Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An URL to a Windows shared folder [duplicate]

Is there a way to incorporate a working link to a Windows shared folder into an HTML page? E.g. a link to \\server\folder\path?

For simplicity, let's say the page will be opened on a Windows machine (and on the same intranet where the server is located, of course.)

I've tried a few tricks with file:// scheme, but none of them seemed to work.

like image 878
alex Avatar asked Apr 26 '11 20:04

alex


People also ask

How do I copy a link to a shared folder?

If the folder location is on a network server drive, you can click in the address bar to copy/paste it. It's up to your email program for whether that link becomes "clickable" or not, but even if they can't click it, the email recipient could just copy/paste the link.

How do I copy a link to a shared drive in Windows?

Hold Shift down and right-click on the file and select "Copy as path". Insert a Hyperlink in the email and paste in the address field of the Hyperlink dialogue box. After you create the hyperlink in the email, you're done. The link will show the mapped drive letter this is true.

How do I create a link to a shared folder in Microsoft?

If you're using Windows 10, hold down Shift on your keyboard and right-click on the file, folder, or library for which you want a link. If you're using Windows 11, simply right-click on it. Then, select “Copy as path” in the contextual menu.

Which makes a duplicate copy of a folder?

Alternatively, right-click the folder, select Show more options and then Copy. In Windows 10 and earlier versions, right-click the folder and select Copy, or click Edit and then Copy. Navigate to the location where you want to place the folder and all its contents.


1 Answers

I think there are two issues:

  1. You need to escape the slashes.
  2. Browser security.

Explanation:

  1. I checked one of mine, I have the pattern:

    <a href="file://///server01\fshare\dir1\dir2\dir3">useful link </a> 

    Please note that we ended up with 5 slashes after the protocol (file:)

  2. Firefox will try to prevent cross site scripting. My solution was to modify prefs.js in the profile directory. You will add two lines:

    user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess"); user_pref("capability.policy.localfilelinks.sites", "http://mysite.company.org"); 
like image 177
Bill Avatar answered Oct 08 '22 03:10

Bill