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