[WEB4LIB] Can IE 6.0 and Mozilla 1.0 access local files?

Thomas Dowling tdowling at ohiolink.edu
Fri Oct 11 08:58:03 EDT 2002


At 11:08 PM 10/10/2002, plim at ccsf.edu wrote:
>Hi all,
>
>We have some links on our Homepage that are used to access
>CDROM programs on our server, they work fine with I.E. 5.5
>and Netscape 4.73. But the links don't work when we use I.E.
>6 and Mozilla 1.0 browsers. The format of the link is:
>
>file://C:\Program Files\lceasy\LCEASY.exe
>or
>file:///c:\batch/nyt.pif
>
>I wonder if anyone knows anyway to modify the links to work
>with these new browsers.

There seem to be two issues here: writing file URLs correctly, and the 
notion of accessing programs.

You write file URLs by following the directions in RFC1738, the standard 
for URLs.  The newness of the browser doesn't affect that; it just shows 
you where you've been relying on bugs in old browsers.

    RFC1738 3.10:
    A file URL takes the form:

        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>.

The URL path is delimited by *forward* slashes, regardless of what the 
operating system uses.

Because the colon from the drive letter is a reserved character in URLs, 
there is a convention to replace it with a vertical pipe character, though 
my copies of Mozilla, IE, and Opera understand it both ways (Mozilla and 
Opera also correctly understand hex-escaped %3A, but not IE - quelle surprise).

Try "file://localhost/d|/dir/subdir/filename.ext" or (leaving out the 
"host" which is often nonsensical for file URLs) 
"file:///d|/dir/subdir/filename.ext".

You should hex-escape spaces as "%20": "file:///c|/program%20files/..."


That will display the contents of the file in the browser.  However, for 
reasons of security, browsers do not launch executable programs.  The 
Web4Lib archives will have lots of references to third-party utilities that 
can do that for you.


Thomas Dowling
OhioLINK - Ohio Library and Information Network
tdowling at ohiolink.edu




More information about the Web4lib mailing list