An URL to a Windows shared folder
I think there are two issues:
- You need to escape the slashes.
- Browser security.
Explanation:
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:
)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");
What are the ways to make an html link open a folder
Do you want to open a shared folder in Windows Explorer? You need to use a file:
link, but there are caveats:
- Internet Explorer will work if the link is a converted UNC path (
file://server/share/folder/
). - Firefox will work if the link is in its own mangled form using five slashes (
file://///server/share/folder
) and the user has disabled the security restriction onfile:
links in a page served over HTTP. Thankfully IE also accepts the mangled link form. - Opera, Safari and Chrome can not be convinced to open a
file:
link in a page served over HTTP.
Is it possible to link a file from shared drive on public facing website?
it is possible , but \\server (Windows UNC port 445) is a port that was abused and is blocked by many ISP's for almost a decade now.
Your "public" most likely will not have access
file:/// will not work either , as to the user, that means the persons local machine
what you can do is create a virtual directory to your drive or network share in IIS and make sure in iis (optionally can you can enable use directory browsing)
ftp:// is also a possibility as well and what i think you should look into
Linking a UNC / Network drive on an html page
To link to a UNC path from an HTML document, use file:///// (yes, that's five slashes).
file://///server/path/to/file.txt
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:
For security purposes, Mozilla
applications block links to local
files (and directories) from remote
files.
And less directly, from Google:
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.
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.
Using Python, how can I access a shared folder on windows network?
Use forward slashes to specify the UNC Path:
open('//HOST/share/path/to/file')
(if your Python client code is also running under Windows)
Related Topics
When to Use <Span> Instead <P>
Why Doesn't Width/Height Work with Non Positioned Pseudo Elements
At The End of The Day, Why Choose Xhtml Over HTML
How to Connect a Child Item in a Tree-Structure Visualization with CSS
How to Vertically Align a Table in CSS
Method to Convert HTML5 Canvas to Svg
How to Show PDF File in Ionic App with Out Download
Add Border to Div Increase Div Width
Background Video with 100% Width and Fixed Height
Bootstrap Navbar Link Color Won't Change
Change Bootstrap Input Focus Blue Glow
How to Validate Pattern Matching in Textarea
How to Pretty-Print HTML with Nokogiri
"TáCo" Is Wider Than "Taco". How to Fix That
Center a Div Horizontally and Vertically and Keep Centered When Resizing The Parent
Is Form Enctype "Application/JSON" Available