Forum Moderators: open

Message Too Old, No Replies

How do I open a local file?

how do I create a link to a local file via html?

         

JerryOdom

8:37 pm on Oct 13, 2005 (gmt 0)

10+ Year Member



I'm trying to open the test file on my local windows machine ala....

<a href="file://C:/Program Files/test.html">here</a>

doesn't work. Someone help me out? I can't believe I've never had to do this before. lol. kinda frustrating.

CtrlAltDimension

9:04 pm on Oct 13, 2005 (gmt 0)

10+ Year Member



Try file:///

Three slashes should do the trick.

JerryOdom

1:29 pm on Oct 14, 2005 (gmt 0)

10+ Year Member



<a href="file:///C:/options.html">here</a>

doesn't work either. I think I just ran down a discussion thread that says the file:/// is something implemented so that people can't link to local files via href tags. Can anyone confirm this is how it is?

kaled

2:00 pm on Oct 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try href="C:\test.html"
Note that this uses \ rather than / and does not include any spaces. This assumes IE rather than FF, Opera, etc.

Kaled.

Robin_reala

2:02 pm on Oct 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In Firefox go File / Open File, find your file, and load it. Then the URL bar will show the correct link for your HTML.

encyclo

2:06 pm on Oct 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you are attempting to open a local file from a remote site then it won't work - it would be a huge security breach if links on remote sites could open or execute files on a local machine.

JerryOdom

2:13 pm on Oct 14, 2005 (gmt 0)

10+ Year Member



I'm pretty sure encyclo is right guys. bummer. I guess you learn something new everyday.