The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Href to a local file
johno
post 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'
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jan 3 2008, 03:58 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,308
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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
johno
post Jan 3 2008, 04:07 PM
Post #3





Group: Members
Posts: 3
Joined: 3-January 08
Member No.: 4,634



QUOTE(Darin McGrew @ Jan 3 2008, 01:58 PM) *

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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 3 2008, 04:25 PM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,350
Joined: 9-August 06
Member No.: 6



It should be file://localhost/C:/test%20bed/documents/list.doc .
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jan 3 2008, 04:25 PM
Post #5


WDG Member
********

Group: Root Admin
Posts: 8,308
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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
johno
post Jan 3 2008, 05:41 PM
Post #6





Group: Members
Posts: 3
Joined: 3-January 08
Member No.: 4,634



QUOTE(pandy @ Jan 3 2008, 02:25 PM) *

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 4 2008, 01:40 AM
Post #7


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,350
Joined: 9-August 06
Member No.: 6



QUOTE(johno @ Jan 3 2008, 11:41 PM) *

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. wacko.gif

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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Lubomir
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Ephraim F. Moya
post 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



QUOTE(Lubomir @ Dec 14 2011, 02:32 PM) *

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'.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th August 2019 - 07:11 AM