Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<A>nchor Link to Local File? (<a href='file:///{path}'>DEAD LINK</a> not working in FireFox but in IE)

This Java code,

"<a href='file:///" + curBP.get_build_path() + "'>" + curBP.get_build_path() + "</a>"

is outputted to the browser.

On the page, the HTML is:

<a href="file:///\\path\to\shared\file">Shared File</a>

However, it does not open the file. I've tried countless other combinations of slashes, but to no avail. In FireFox, it acts like a dead link and does not open the file. In IE, it works.

Any idea as to how to make it work in FireFox? Thanks!

like image 665
Garrett Avatar asked Jan 21 '11 21:01

Garrett


2 Answers

Bad news: Firefox has closed a security hole:

http://www.techlifeweb.com/firefox/2006/07/how-to-open-file-links-in-firefox-15.html

It requires the user to modify a local file to allow file:// urls.

like image 142
Chris B. Behrens Avatar answered Sep 27 '22 17:09

Chris B. Behrens


When you use backslashes {} , you're calling Windows Explorer. And IE is integrated with Windows Explorer, FF not integrated

like image 31
Eray Avatar answered Sep 27 '22 18:09

Eray