When i type in the following link manually in firefox as " file://///", pdf file is loaded successfully in the firefox browser. PDF file is located in remote server which is referred by IP

I've assigned the Same link in a String in jsp page and tested it through my tomcat application as

String linktotest="file://///";

<a href="<%=linktotest%>">link</a>

when i click on the hyperlink , the pdf is not loaded in firefox and i'm getting the following error in firefox error console

Security Error: Content at may not load or link to file://///

can any one please give me the solution.

8 Years
Discussion Span
Last Post by ~s.o.s~

> Security Error:

It seems as though Firefox distinguishes between unsafe URI embedded in web pages and those written out explicitly in the location bar. IMO, this happens so because native executables when accessed using the FILE protocol directly execute and this might pose a *big* security vulnerability if the user has admin rights or if the referenced resource is something malicious. To try it out, type file://C:/WINDOWS/system32/cmd.exe in your location bar if using Windows and see for yourself.

A sensible workaround: serve the files using HTTP; i.e. run a HTTP server on the target machine or the machine on which the application is deployed and reference the resource via the HTTP protocol. FTP is also a viable option.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.