Questions tagged [file-uri]

The file URI scheme is a URI scheme specified in RFC 8089 (previously, RFC 1630 and RFC 1738), typically used to retrieve files from within one's own computer.

A file URL takes the form of

file://host/path

where host is the fully qualified domain name of the system on which the path is accessible, and path is a hierarchical directory path of the form directory/directory/.../name. If host is omitted, it is taken to be "localhost", the machine from which the URL is being interpreted.

Note that when omitting host you do not omit the slash ("file:///foo.txt" is okay, while "file://foo.txt" is not, although some interpreters manage to handle the latter).

Examples:

Unix: file://localhost/etc/fstab
Windows: file://localhost/c$/WINDOWS/notepad.exe

110 questions
504
votes
29 answers

Convert file: Uri to File in Android

What is the easiest way to convert from an android.net.Uri object which holds a file: type to a java.io.File object in Android? I tried the following but it doesn't work: File file = new File(Environment.getExternalStorageDirectory(),…
hpique
  • 119,096
  • 131
  • 338
  • 476
198
votes
30 answers

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

The following code works in Google Chrome beta as well as IE 7. However, Firefox seems to have a problem with this. I'm suspecting it to be a problem of how my CSS files are included, cause I know Firefox is not too friendly about cross-domain…
KG -
  • 7,130
  • 12
  • 56
  • 72
105
votes
8 answers

File Uri Scheme and Relative Files

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.
user592419
  • 5,103
  • 9
  • 42
  • 67
69
votes
9 answers

HTML 5 Geo Location Prompt in Chrome

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…
AGoodDisplayName
  • 5,543
  • 7
  • 35
  • 50
64
votes
5 answers

How to specify a local file within html using the file: scheme?

I'm loading a html file hosted on the OS X built in Apache server, within that file I am linking to another html file in the same directory as follows: This works. However (for…
Gruntcakes
  • 37,738
  • 44
  • 184
  • 378
44
votes
4 answers

An URL to a Windows shared folder

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…
alex
  • 925
  • 1
  • 7
  • 9
26
votes
2 answers

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

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…
Bart
  • 6,694
  • 6
  • 43
  • 53
26
votes
1 answer

What is the Vagrant syntax for adding a locally existing VDI?

What is the syntax for adding a locally existing VirtualBox .vdi to vagrant? There doesn't appear to be an example of alternate URI schemes in the documentation. Can it also use ssh and httpauth locations?
vfclists
  • 19,193
  • 21
  • 73
  • 92
19
votes
1 answer

Chrome - Fetch API cannot load file. How to workaround?

I have the following two files: index.html Web Page