Href to a local file |
Href to a local file |
johno |
Jan 3 2008, 03:28 PM
Post
#1
|
Group: Members Posts: 3 Joined: 3-January 08 Member No.: 4,634 |
Newbie question:
I am trying to use an href element to create a link to a local file on a test web page: href="C:\meeting notes\minutes-august 16.doc" When I render the page it looks like a link, but the document won't launch. If I copy the href directly to a new browser session it works fine...any suggestions? Thanks. John O' |
Darin McGrew |
Jan 3 2008, 03:58 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
Where is the document with the link? If it's in the same directory, then you can use a relative URL like href="minutes-august%2016.doc" (spaces in URLs must be encoded as %20).
|
johno |
Jan 3 2008, 04:07 PM
Post
#3
|
Group: Members Posts: 3 Joined: 3-January 08 Member No.: 4,634 |
Where is the document with the link? If it's in the same directory, then you can use a relative URL like href="minutes-august%2016.doc" (spaces in URLs must be encoded as %20). The document with the link is in a different directory, thus the need for an absolute path. I get an automatic conversion of spaces to %20, but I also see the back slashes are being converted to forward slashes, so this C:/test bed/documents/list.doc is converted to C:\test%20bed\ocumentslist.doc |
pandy |
Jan 3 2008, 04:25 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It should be file://localhost/C:/test%20bed/documents/list.doc .
|
Darin McGrew |
Jan 3 2008, 04:25 PM
Post
#5
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
You can use a relative URL. Please see the FAQ entry How can I avoid using the whole URL?
|
johno |
Jan 3 2008, 05:41 PM
Post
#6
|
Group: Members Posts: 3 Joined: 3-January 08 Member No.: 4,634 |
It should be file://localhost/C:/test%20bed/documents/list.doc . Sorry to be a pest, but no luck. I'm running the free version of FacetMap on a local Apache server...it seems to already have a localhost parameter, and it will launch a website URL, but not a local file. |
pandy |
Jan 4 2008, 01:40 AM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Sorry to be a pest, but no luck. I'm running the free version of FacetMap on a local Apache server...it seems to already have a localhost parameter, and it will launch a website URL, but not a local file. Is that server on IIS? Because if it is on Unix/Linux, that path with c:\ and stuff isn't realistic. I don't know how this 'remote desktop' works, but why don't you just upload the HTML doc with the relative URL and see if it works when it's in place? It's no biggie to correct it if it doesn't. |
Lubomir |
Dec 14 2011, 04:32 PM
Post
#8
|
Group: Members Posts: 1 Joined: 14-December 11 Member No.: 16,070 |
href="C:\meeting notes\minutes-august 16.doc"
try this href="file:///C:/meeting%20notes/minutes-august%2016.doc This post has been edited by Lubomir: Dec 14 2011, 04:34 PM |
Ephraim F. Moya |
Dec 18 2011, 01:24 PM
Post
#9
|
Advanced Member Group: Members Posts: 167 Joined: 2-September 07 From: New Mexico Member No.: 3,702 |
href="C:\meeting notes\minutes-august 16.doc" try this href="file:///C:/meeting%20notes/minutes-august%2016.doc This seems like the same problem as here: http://forums.htmlhelp.com/index.php?showtopic=15401 The simple answer is that it can't be done. It opens a security hole the size of Denver. But... Using Javascript and the Chrome browser and some judicious hacking can (sometimes) allow doing it. Search Google for 'read local file on web page'. |
Lo-Fi Version | Time is now: 24th April 2024 - 04:25 PM |