MAGAZÍN D'INVESTGACIÓ PERIODÍSTICA (iniciat el 1960 com AUCA satírica.. per M.Capdevila a classe de F.E.N.)
-VINCIT OMNIA VERITAS -
VOLTAIRE: "El temps fa justícia i posa a cadascú al seu lloc.."- "No aniràs mai a dormir..sense ampliar el teu magí"
"La història l'escriu qui guanya".. així.. "El poble que no coneix la seva història... es veurà obligat a repetir-la.."
24-01-2014 (1765 lectures) | Categoria: Articles |
File URL scheme
The file URL scheme is a URL scheme specified in 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).
The slash character (/), depending on its position, has different meanings within a file URL.
Here are two Unix examples pointing to the same /etc/fstab file:
file://localhost/etc/fstab
file:///etc/fstab
Here are some examples which may be accepted by some applications on Windows systems, referring to the same, local file c:WINDOWSclock.avi
file://localhost/c|/WINDOWS/clock.avi
file:///c|/WINDOWS/clock.avi
file://localhost/c:/WINDOWS/clock.avi
Here is the URI as understood by the Windows Shell API:[1]
file:///c:/WINDOWS/clock.avi
On Microsoft Windows systems, the normal colon (:) after a device letter has sometimes been replaced by a vertical bar (|) in file URLs. This reflected the original URL syntax, which made the colon a reserved character in a path part.
Since Internet Explorer 4, file URIs have been standardized on Windows, and should follow the following scheme. This applies to all applications which use URLMON or SHLWAPI for parsing, fetching or binding to URIs. To convert a path to a URL, use UrlCreateFromPath
, and to convert a URL to a path, use PathCreateFromUrl
. [1]
To access a file "the file.txt", the following might be used.
For a network location:
file://hostname/path/to/the%20file.txt
Or for a local file, the hostname is omitted, but the slash is not (note the third slash):
file:///c:/path/to/the%20file.txt
This is not the same as providing the string "localhost" or the dot "." in place of the hostname. The string "localhost" will attempt to access the file as localhostc:pathtothe file.txt, which will not work since the colon is not allowed in a share name. The dot "." results in the string being passed as .c:pathtothe file.txt, which will work for local files, but not shares on the local system. For example file://./sharename/path/to/the%20file.txt will not work, because it will result in sharename being interpreted as part of the DOSDEVICES namespace, not as a network share.
The following outline roughly describes the requirements.
Use the provided functions if you can. If you must create a URL programmatically and you cannot access SHLWAPI.dll (for example from script, or another programming environment where the equivalent functions are not available) the above outline will help.
To aid the installed base of legacy applications, the PathCreateFromUrl
recognizes certain URLs which do not meet these criteria, and treats them uniformly. These are called "legacy" file URLs as opposed to "healthy" file URLs. [2]
In the past, a variety of other applications have used other systems. Some added an additional two slashes. For example, emotehostsharedirfile.txt, would become file:////remotehost/share/dir/file.txt instead of the "healthy" file://remotehost/share/dir/file.txt.
File URLs are rarely used in Web pages on the Internet, since they make the assumption that such a file exists on the client's computer. The host specifier can be used to retrieve a file from an external source, although no specific file-retrieval protocol is specified; and using it should result in a message that informs the user that no mechanism to access that machine is available.
use extension "LocalLinks"[2]
Add site to Trusted Sites (Internet Options->Security-> Trusted Sites).[3]
within directory c:Users<<USERNAME>>AppDataRoamingMozillaFirefoxProfiles<<***>>.default[4] create file user.js which contains the following:[5]
user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");
user_pref("capability.policy.localfilelinks.sites", "http://intranet http://wiki http://bugzilla HTTP://EXAMPLE");
user_pref("capability.policy.policynames", "localfilelinks");
or use addon "Local Filesystem Links"[6]
click right – "save..."
The original Web browser, WorldWideWeb, provided editing of resources in file space [3]. Amaya still has this ability.