That's because when you use href="/tmp/hello.xls"
, the browser will interpret that as an absolute path relative to the current domain, i.e. http://your_website_domain/tmp/hello.xls
, which may not be what you want
If you're targetting /tmp/hello.xls
on the client machine
To target a local file, you'll need to specify href="file:///tmp/hello.xls"
. Unfortunately, that may not work on some browsers which security settings in place which stops the loading of local files from external content.
For more details and a possible workaround, check out this question: How do I make a file:// hyperlink that works in both IE and Firefox?
If you're targetting /tmp/hello.xls
on the web server
You cannot directly access a file on the server that's not in the web root.
If you give more details about what you're trying to achieve, we might be able to give more specific advice.