An URL to a Windows shared folder [duplicate]

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=”https://stackoverflow.com/questions/5796215/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 … Read more

File Uri Scheme and Relative Files

In short, a file URL takes the form of: file://localhost/absolute/path/to/file [ok] or you can omit the host (but not the slash): file:///absolute/path/to/file [ok] but not this: file://file_at_current_dir [no way] nor this: file://./file_at_current_dir [no way] I just confirmed that via Python’s urllib2.urlopen() More detail from http://en.wikipedia.org/wiki/File_URI_scheme: “file:///foo.txt” is okay, while “file://foo.txt” is not, although some interpreters … Read more

CSS @font-face not working with Firefox, but working with Chrome and IE

LOCALLY RUNNING THE SITE (file:///) Firefox comes with a very strict “file uri origin” (file:///) policy by default: to have it to behave just as other browsers, go to about:config, filter by fileuri and toggle the following preference: security.fileuri.strict_origin_policy Set it to false and you should be able to load local font resources across different … Read more

Convert file: Uri to File in Android

What you want is… new File(uri.getPath()); … and not… new File(uri.toString()); Notes For an android.net.Uri object which is named uri and created exactly as in the question, uri.toString() returns a String in the format “file:///mnt/sdcard/myPicture.jpg”, whereas uri.getPath() returns a String in the format “/mnt/sdcard/myPicture.jpg”. I understand that there are nuances to file storage in Android. … Read more