file-uri

How to open a specific URL in a specific browser from a link?

柔情痞子 提交于 2019-11-28 04:31:37
问题 Even though IE is our default browser we want users to open links from email notifications in Firefox. So I tried: <a href="file:///C:\Program Files (x86)\Mozilla Firefox\firefox.exe">Click me!</a> which works just fine, but when I try to pass the URL onto it it doesn't: <a href="file:///C:\Program Files (x86)\Mozilla Firefox\firefox.exe google.com">Click me!</a> What am I missing? 回答1: From a URL, you can't target a specific browser. That's a client preference and not something that you can

Local file protocol for java.net.URL

你说的曾经没有我的故事 提交于 2019-11-28 00:59:49
What's the protocol for local files using URL? I've downloaded a file using Java and I need to know how to access it, not using File, but using URL. Thanks! Unix file://localhost/<path> file:///<path> Windows file://localhost/<drive>|/<path> file:///<drive>|/<path> file://localhost/<drive>:/<path> file:///<drive>:/<path> For more information see the related Wikipedia article . You may use file:/// and file path. For e.g. file:///c:/temp.txt 来源: https://stackoverflow.com/questions/8406025/local-file-protocol-for-java-net-url

File Uri Scheme and Relative Files

扶醉桌前 提交于 2019-11-27 18:27:21
Assume that the scheme for a uri is "file". Also assume that the path starts with '.' An example path is './.bashrc'. How would the fulluri look? 'file://./.bashrc' appears odd to me. 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

Java : File.toURI().toURL() on Windows file

我们两清 提交于 2019-11-27 13:02:09
问题 The system I'm running on is Windows XP, with JRE 1.6. I do this : public static void main(String[] args) { try { System.out.println(new File("C:\\test a.xml").toURI().toURL()); } catch (Exception e) { e.printStackTrace(); } } and I get this : file:/C:/test%20a.xml How come the given URL doesn't have two slashes before the C: ? I expected file://C:... . Is it normal behaviour? EDIT : From Java source code : java.net.URLStreamHandler.toExternalForm(URL) result.append(":"); if (u.getAuthority()

URI scheme is not “file”

爷,独闯天下 提交于 2019-11-27 06:41:05
问题 I get the exception: "URI scheme is not file" What I am doing is trying to get the name of a file and then save that file (from another server) onto my computer/server from within a servlet. I have a String called "url", from thereon here is my code: url = Streams.asString(stream); //gets the URL from a form on a webpage System.out.println("This is the URL: "+url); URI fileUri = new URI(url); File fileFromUri = new File(fileUri); onlyFile = fileFromUri.getName(); URL fileUrl = new URL(url);

Javascript/HTML Storage Options Under File Protocol (file://)

倖福魔咒の 提交于 2019-11-27 04:29:23
问题 I am developing an html application that is essentially a series of pages like a book. Within this application, I would like to store several JavaScript variables across pages. Think things like pages read, bookmarks, etc. When this application is viewed over HTTP, I plan to use localStorage with fallbacks for older browsers (globalStorage, userData, etc.). However, this completely breaks down if the files are accessed via "file://", for example if viewed off of a CD. It seems that most (if

An URL to a Windows shared folder [duplicate]

别说谁变了你拦得住时间么 提交于 2019-11-27 03:50:34
This question already has an answer here: Linking a UNC / Network drive on an html page 3 answers 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. Bill 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://

file: URIs and Slashes

痞子三分冷 提交于 2019-11-27 02:17:52
问题 An application I'm working on involves accessing files on network file shares, and we're using URIs to specify the files' locations. My understanding of the file: URI is that they should take the form of file:// + path . In the case of a Windows network share, this path looks something like \\servername\dir\file , so the resultant URI becomes file:////servername/dir/file . This seems to be working great for Java's URI class, but the Win32 API seems to want a file://servername/dir/file style

HTML 5 Geo Location Prompt in Chrome

左心房为你撑大大i 提交于 2019-11-26 11:43:25
Just starting to get into HTML 5 and an testing out geo location...liking it so far. I am hitting a bit of a speed bump though...when I try to get my geo location, chrome automatically blocks the page from getting my location. This does not happen at other sites such as the site below: http://html5demos.com/geo The scripts I'm using: <script type="text/javascript" JavaScript" SRC="geo.js"></script> <script type="text/javascript" JavaScript" SRC="Utility.js"></script> <script type="text/javascript" JavaScript" SRC="jquery.js"></script> <script type="text/javascript" JavaScript" SRC="modernizr

An URL to a Windows shared folder [duplicate]

纵饮孤独 提交于 2019-11-26 10:45:30
问题 This question already has an answer here: Linking a UNC / Network drive on an html page 3 answers 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. 回答1: I think there are two issues: You need to