Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

What is the path structure, when I OPEN a local html file on my C drive?

  • 3 ردود
  • 9 have this problem
  • 2 views
  • آخر ردّ كتبه cor-el

more options

I downloaded WikiLeak's afgan diary html, which has links with the following format: "file:///afgan/type/air raid_0.htm". However I put the files in a folder "My Documents\WikiLeaks\HTMLfiles". So now the link does not work. What is wrong?

This happened

Every time Firefox opened

I downloaded WikiLeak's afgan diary html, which has links with the following format: "file:///afgan/type/air raid_0.htm". However I put the files in a folder "My Documents\WikiLeaks\HTMLfiles". So now the link does not work. What is wrong? == This happened == Every time Firefox opened

الحل المُختار

No, that is a path to a server and likely malformed because in that case you need 5 slashes. To locate a file on the C drive you need to use file:///C:/Documents and Settings/<user>/My Documents/WikiLeaks/HTMLfiles

If links are hard coded like you wrote them then it may be a lot of work to get it working.

You can use a bookmarklet like this to fix links in Firefox and save the page if the links are working: javascript:(function() }alert(j);})(); You need to change the S and R variables to the proper file path. In the regular expression you need to escape a "/" as "\/" and a dot (.) as [.]

See also https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/RegExp

Read this answer in context 👍 0

All Replies (3)

more options

Easiest to do that is to open the file via File > Open File and copy the URL from the location bar. You can also drag the file in a Firefox window (tab).

more options

As I explained previously: I downloaded WikiLeak's afgan diary html, which has links with the following format: "file:///afgan/type/air raid_0.htm". However I put the files in a folder "My Documents\WikiLeaks\HTMLfiles". So now the link does not work. Here is an example of what I mean:

Browse by Type air mission (431) counter insurgency (4) counter-insurgency (39) criminal event (480) detainee operations (1208) enemy (13) enemy action (27078) explosive hazard (23082) friendly action (13734) friendly fire (148) non-combat event (7719) other (2752) suspicious incident (208) unknown initiated action (12)

I clicked on "counter insurgency (4)" and that link did NOT work. Looking at that URL, this is the contents: "file:///afg/sort/type/counter_insurgency_0.html" Is that the correct format to get to that local file on my C drive?

more options

الحل المُختار

No, that is a path to a server and likely malformed because in that case you need 5 slashes. To locate a file on the C drive you need to use file:///C:/Documents and Settings/<user>/My Documents/WikiLeaks/HTMLfiles

If links are hard coded like you wrote them then it may be a lot of work to get it working.

You can use a bookmarklet like this to fix links in Firefox and save the page if the links are working: javascript:(function() }alert(j);})(); You need to change the S and R variables to the proper file path. In the regular expression you need to escape a "/" as "\/" and a dot (.) as [.]

See also https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/RegExp