jackson
jackson

Reputation: 11

link to local disk

Is it possible to put a html link on a page that opens a file in local disk?

Like c:/myFolder/myfile.xls

This page is not actually going to be on web, but this feature would be needed for demostration purposes only. When the page is on web, the file is too, and link has url value.

Upvotes: 1

Views: 10619

Answers (4)

ryryan
ryryan

Reputation: 3928

This would be a risky thing to do. As not everybody uses a PC, it will be different for a mac and a linux than a PC. Also not all browsers allow you to do it, such as Firefox, it dis-allows it due to potential security risks. But anyway here's the html code if you still wish to do it:

<a href="file:///C:/myFolder/myfile.xls">Click Here</a>

Upvotes: 3

mor22
mor22

Reputation: 1372

You could use

<a href="c:/myFolder/myfile.xls">my link</a>

Be wary that this may not work for all browsers (ie firefox) due to security reasons (See here) and it certainly wont work for other people accessing the webpage.

Upvotes: 3

mjgirl
mjgirl

Reputation: 21

Tried it, but link does not open a thing. Sorry, I could not put this as a comment. Please edit.

Upvotes: 0

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798606

You want to use the file: scheme.

file://C|/myFolder/myfile.xls

Upvotes: 0

Related Questions