Results 1 to 9 of 9

Thread: trouble linking to a local file

  1. #1
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default trouble linking to a local file

    1) Script Title: All Levels Navigational Menu (v2.0)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...menu/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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd recommend relative paths then, otherwise you would need to use something like:

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

    Code:
    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:

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

    Code:
    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/th...id/110917.html
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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>

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This is just wrong:

    ..Motor.pdf
    It should probably be:

    Code:
    ../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:

    Code:
    href="../files/some.htm"
    for a file named 'some.htm' in child folder named 'files' of the parent folder of the current folder.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    href="pdf\whatever.pdf"
    should work fine in any browser.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. The Following User Says Thank You to jscheuer1 For This Useful Post:

    markdavidson (12-31-2008)

  8. #7
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  9. #8
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  10. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    None of that should matter, but I'm just glad that you can do what you want. Good luck with your project.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •