File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes how to link external files from web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to link external files from web application" Watch "how to link external files from web application" New topic

how to link external files from web application

ravi v kumar
Ranch Hand

Joined: Dec 14, 2004
Posts: 56
Hi all,

i want to place the link in my web application which will download/show the file from location in server.

for this i am using
<a href="file://<filepath>">link</a>
but i am not able to suceed with this. is there anything i need to do?

Thanks in Adavance
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30074

file:// means a file on the local users Windows machine. If you want a path on the server, you need to write a servlet to retrieve it.

If this is a real world application, you want to use some sort of code/key rather than the fully qualified file path. For security, it is best the user not know too much about your server.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
As Jeanne said, since you are dealing with the web, it still is an http request. You link to the file just like you link to an jsp or html page.

I agree. Here's the link:
subject: how to link external files from web application
Similar Threads
weblogic 9- authentication
Deployment problem on Oc4j
Struts 2.0.9 - Problem in following a hyper link
Unable to view application
Ejb deployment issue