On some input we allow the following paths:
Can I mark them all as "URI"s?
A local path is the path to a folder or file on your local computer (e.g. C:\Program Files\Sitebulb). A UNC path is the path to a folder or file on a network and contains the server name in the path (e.g. \\server01\sitebulb\path).
A URL (Uniform Resource Locator) identifies a resource on a remote server and gives the network location on that server. The URL path is the string of information that comes after the top level domain name. You can use the HTTP-proxy to block websites that contain specified text in the URL path.
URIs are always absolute (unless they're relative URIs, which is a different beast without a schema). That comes from them being a server-client technology where referencing the server's working directory doesn't make sense.
C:/Folder
and /server/Folder/
are file paths.
http://example.com/
is a URL, which is a URI sub-type, so you could mark it as a URI but not the other way around (like how squares are rectangles but not vice versa).
Of course, here you have posted a clear, simple example. When discussing the distinction between URI and URL, not only is the answer not clear cut, it is also disputed. I recommend taking a look at this thread and the answers posted in it for clarification. Generally though, it is mostly agreed that the main difference is that URLs provide an access method (such as http://).
So if we were to convert your first file path into a URL it would become the following (note the addition of the access method):
file:///c:/Folder/test.txt
If you modify all your file paths to include an access method like in my example, then it will be okay for you to mark them as URIs.
Strictly speaking no, unless you make sure it's an absolute path and add add "file://
" to the beginning.
As per RFC 3986 Section 3:
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty
The scheme
and the ":"
are not in square brackets []
, which means they are not optional.
However, the HTML standard calls these "path-relative-scheme-less-URL strings" and they're valid in the href
attribute of an HTML element so maybe it's fine to call relative Unix paths "URLs" (not absolute Unix paths or Windows paths though).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With