1

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.

leppie
  • 115,091
  • 17
  • 196
  • 297
jackson
  • 11
  • 1
  • 2

4 Answers4

3

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.

mor22
  • 1,372
  • 1
  • 15
  • 32
3

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>
ryryan
  • 3,890
  • 13
  • 43
  • 72
0

You want to use the file: scheme.

file://C|/myFolder/myfile.xls
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

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

mjgirl
  • 21
  • 1