PDA

View Full Version : Resolved trouble linking to a local file



markdavidson
12-31-2008, 04:02 PM
1) Script Title: All Levels Navigational Menu (v2.0)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/index.htm

3) Describe problem: the only problem i am having is i cant seem to link to a local file, URLs work just fine. but i am trying to link to documents on the local machine. i am making an interactive cd, so all the links would be local
thanx

jscheuer1
12-31-2008, 05:04 PM
I'd recommend relative paths then, otherwise you would need to use something like:


href="file:///DRIVE_LETTER:/PATH/FILENAME.EXT"

or:


href="file://localhost/DRIVE_LETTER:////PATH/FILENAME.EXT"

and since you don't know the drive letter, that would be tough.

There may be a way around that, but since, for example:


href="index.htm"

will always work as long as you are in the folder where index.htm resides, and:


href="../some.htm"

will always point to the containing folder's "some.htm" if it is there. That would appear to be the way to go. You just have to find a way to change to the root of the 'site' on the CD. This is generally done with a higher level programming language's application, but could probably also be done with batch files.

See also:

http://answers.google.com/answers/threadview/id/110917.html

markdavidson
12-31-2008, 05:34 PM
first of all thanx for responding John, also thankyou for the link
pasted below is a portion of the script i am refering to, i cant get this to work even when i know where everything is located. if i replace one of my links to with a URL "http://www.yahoo.com" or whatever it works fine. otherwise nothing

<!--Side Drop Down Menu 1 HTML-->

<ul id="ddsubmenuside1" class="ddsubmenustyle blackwhite">
<li><a href="parts/3chain.xls">Parts</a></li>
<li><a href="dwgs/3chain dwgs.pdf">Drawings</a></li>
<li><a href="#">Manuals</a>
<ul>
<li><a href="..Motor.pdf" target= "I1">Drive Motor</a></li>
<li><a href="pdf/3Chain%20Motor.pdf">Gearbox</a></li>
<li><a href="pdf/3chain%20airbag.pdf">Air Bag</a></li>
</ul>
</li>
</ul>

jscheuer1
12-31-2008, 05:57 PM
This is just wrong:


..Motor.pdf

It should probably be:


../Motor.pdf

for the 'Motor.pdf' file in the parent folder of the current folder.

The others will work if the browser is already on a page in the correct folder, for example for:


pdf/3Chain%20Motor.pdf

this will open the '3Chain%20Motor.pdf' file in the child folder 'pdf' of the current folder.

If your folders are organised differently, you must point to the correct ones.

The folder that the browser is currently 'in' is the folder that the page it is currently showing is in.

This sort of thing will also work for example:


href="../files/some.htm"

for a file named 'some.htm' in child folder named 'files' of the parent folder of the current folder.

markdavidson
12-31-2008, 06:09 PM
yes but unfortunatly its not working. all my htm files are in
"D:\My Documents\My Web Sites\BRWP Chainsaw"... the pdfs are in
"D:\My Documents\My Web Sites\BRWP Chainsaw\pdf" if i type in the full path of
"D:\My Documents\My Web Sites\BRWP Chainsaw\pdf\whatever.pdf",
frontpage atomatically truncates it to pdf/whatever.pdf.
now as i mention if i put in a web address in there instead of a local address, everything is as it should be

jscheuer1
12-31-2008, 06:17 PM
You should probably use a text only editor like NotePad for the final edit of the href values, and test only in the browser after that.

If the folder structure is as you say, then:


href="pdf\whatever.pdf"

should work fine in any browser.

markdavidson
12-31-2008, 06:29 PM
well thanx for your time anyway, but it doesnt i assume it has to do with the
All Levels Navigational Menu (v2.0) script. I cant find it
thanx again
mark

markdavidson
12-31-2008, 07:01 PM
John
I dont understand this but i coppied everything to a pendrive and ran it from there, and everthing works. could this be something to do with a deep menu structure? anyway i guess it really doesnt matter since it will all run from a CD anyway...thanx for your time and patience
mark

jscheuer1
12-31-2008, 08:09 PM
None of that should matter, but I'm just glad that you can do what you want. Good luck with your project.