tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre E. Bar'yudin" <>
Subject Re: Show files on filesystem
Date Wed, 16 Apr 2003 09:06:00 GMT
On Срд, Апр 16, 2003 at 10:35:33 +0200, wrote:
> Hi all,
> I have Tomcat 4.1 running on Linux.
> I have installed Tomcat in /usr/java/jakarta-tomcat/
> In my web application I would like to offer my user the possibilty to view 
> PDF files stored elsewhere on the filesystem.
> The PDF's are in /var/om/pdfs
> In my web application I have a link the user can click. When he does so, a 
> PDF should be downloaded or displayed in the browser.
> How can I achieve this using only Tomcat?

The simpliest way is to make a link to your PDF files.  To the files
themselves you may make a hard link, pointing somewhere under the Tomcat
directory hierarchy.  To link directories, you'll have to use sybmolic
links, which might require some configuration with newer versions of

Another, more generic approach would be to use the standard Java IO API
to read the file from its original location and then just write it out
to the servlet's output stream.



Andre E. Bar'yudin
Phone: (972)-54-882-026       ICQ: 48036924
Home page:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message