MozillaZine

file:/// protocol and relative paths

Discussion of general topics about Seamonkey
daveB
 
Posts: 18
Joined: November 21st, 2002, 7:10 am

Post Posted March 19th, 2003, 7:16 am

Hi,

Can mozilla deal with relative paths in URLs using the file:/// protocol?

I've tried it with a file 'test_page.html' in the same directory as mozilla.exe (file:///test_page.html), but it doesn't seem to work.

Where can I find more obout file:/// in Mozilla?

Any pointers will be much appreiciated.

Cheers,
Dave.

WinNT4 Moz1.3 (20030310)

wget

User avatar
 
Posts: 4701
Joined: November 8th, 2002, 9:51 am
Location: Denmark

Post Posted March 19th, 2003, 7:22 am

Just just normal relative paths:
<a href="foobar.html">click me</a> or <a href="path/path/path/foobar.html">click me</a>

The browser will figure out the rest once you open the files locally.
To the cast and crew of Arrested Development: Thanks for the many great laughs.

daveB
 
Posts: 18
Joined: November 21st, 2002, 7:10 am

Post Posted March 19th, 2003, 7:33 am

wget wrote:Just just normal relative paths:
<a href="foobar.html">click me</a> or <a href="path/path/path/foobar.html">click me</a>


Unfortunately it doesn't work unless there's already an absolute file:/// path already there for the current file.

It would probably be a good idea for me to say what I'm trying to do, as there may be a simpler way to do it than I am trying...

I want to run mozilla from the command-line specifying a page to load from a nearby directory, without using an absolute path. Thepath is an issue because the plan is to put both the browser and content on CD, so I can't rely on the absolute name for the CDROM on MS Windows.

Cheers,
Dave.

Racer
 
Posts: 6108
Joined: November 18th, 2002, 11:07 am

Post Posted March 19th, 2003, 1:17 pm

Local files require a root directory or mount to run from. You can't assume any drive.
Try: file:///C|/test_page.html

On Windows, file:///C:/test_page.html (with the colon) works, but Mozilla will sometimes convert the colon in to a %3A sequence which is kind of annoying. You can also use backslashes file:///C:\test_page.html but again, Mozilla converts the backslash into a %5C for its own amusement. Also, some people using NT 4 have been complaining about needing 5 forward slashes instead of three for some stupid reason. Other OSes don't appear to have that problem.

daveB
 
Posts: 18
Joined: November 21st, 2002, 7:10 am

Post Posted March 20th, 2003, 2:14 am

Thanks for the info,
Dave.

Return to SeaMonkey General


Who is online

Users browsing this forum: No registered users and 2 guests