Hyperlink to Local Files

Soldato
Joined
30 Nov 2005
Posts
3,084
Location
London
Hey,

I'm currently producing an Online Intranet that will be available outside via a web connection and internally.

Is it possible to link to local drives via Hyperlinks?

I've tried variations of these:

Code:
<a href="file://localhost//C:/etc etc">file://localhost//C:/etc etc</a>

But while they work locally, as soon as I upload to my host they stop working.
 
Soldato
Joined
21 Feb 2006
Posts
5,649
Location
Home
*Edit* - Stop working? As in the link isn't clickable or that the link is broken?

You may need to replace the localhost with the address of the server the folders are in.
 
Last edited:
Soldato
OP
Joined
30 Nov 2005
Posts
3,084
Location
London
Perhaps I haven't explained myself well enough.

The Intranet will be online accessible outside the office and anywhere in the world.

When I click on the hyperlink when the HTML file is stored locally (i.e. on my Desktop for example), the file/folder on the C Drive will open.

As soon as I upload the HTML file to my web host, the link no longer opens the file/folder on the C Drive.
 
Soldato
Joined
23 Feb 2009
Posts
4,976
Location
South Wirral
You don't need the 'localhost' part. file:///c:/etc etc should work.

I'd recommend you use relative URL's as much as possible though - otherwise you end up in a mess when relocating to a different drive or directory.

EDIT: Ignore me. I re-read your original post. DON'T link to a file system if this is going on the internet. Really really bad idea .... Make everything a relative URL then put it up.
 
Last edited:
Soldato
Joined
21 Feb 2006
Posts
5,649
Location
Home
Perhaps I haven't explained myself well enough.

The Intranet will be online accessible outside the office and anywhere in the world.

When I click on the hyperlink when the HTML file is stored locally (i.e. on my Desktop for example), the file/folder on the C Drive will open.

As soon as I upload the HTML file to my web host, the link no longer opens the file/folder on the C Drive.

Are the files hosted on the server or on a local computer?
 
Soldato
OP
Joined
30 Nov 2005
Posts
3,084
Location
London
You don't need the 'localhost' part. file:///c:/etc etc should work.

I'd recommend you use relative URL's as much as possible though - otherwise you end up in a mess when relocating to a different drive or directory.

EDIT: Ignore me. I re-read your original post. DON'T link to a file system if this is going on the internet. Really really bad idea .... Make everything a relative URL then put it up.

I've tried with or without localhost, it doesn't work as soon as I upload to the server.

Why is it a bad idea? The intranet is password protected? It's for people accessing it internally even though it's hosted online.

Are the files hosted on the server or on a local computer?

Local computer.
 
Soldato
Joined
21 Feb 2006
Posts
5,649
Location
Home
I've tried with or without localhost, it doesn't work as soon as I upload to the server.

Why is it a bad idea? The intranet is password protected? It's for people accessing it internally even though it's hosted online.



Local computer.

Then you need to replace the localhost with the ip/domain of the computer the files are hosted.

<a href="file://ADDRESS OF COMPUTER/C:/">LINK NAME</a>
 
Last edited:
Caporegime
Joined
18 Oct 2002
Posts
29,491
Location
Back in East London
You can omit "localhost" but not the surrounding slashes. Plus you've got two slashes following the localhost in your OP, should only be one.

Code:
<a href="file:///some/path/to/a/file.ext">Some file</a>

Lets see if vBB will let me link to your hosts file?

You're also at the mercy of what ever security policies are in place, as well as browser built in stuff. I doubt the above link (if vBB permits it) will work in any browsers. In Chrome it appears to be just a dead click.
 
Last edited:
Back
Top Bottom