tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parsons Technical Services" <parsonstechni...@earthlink.net>
Subject Re: tomcat 5.5/win & loading external image files
Date Sat, 02 Apr 2005 05:31:31 GMT
Tomcat cannot serve up files outside the root of the app. To do what you 
want requires a work around that has been discussed and debated on this list 
several times. If this is what you have to have, then write a servlet that 
responds to a pattern setup for the images 
(http://www.yoursite.com/yourapp/imagefiles/mypic.jpg). Map the servlet to 
answer for any /imagefiles/* request. Then have the servlet parse the file 
name, read from disk (the directory you want) and serve the file out in 
response to the request.

Other options include using a database to store the images or putting the 
images in the app. One other suggestion was to have an app just for images.

It really is just what fits your needs the best and the pros and cons of 
each. IE You can't move this app to a Linux box without a rewrite.

Doug


----- Original Message ----- 
From: <edwardeguard-cosita@yahoo.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, April 01, 2005 10:23 PM
Subject: tomcat 5.5/win & loading external image files


>i need to load a bunch of image files located outside my exploded war
> file.  for example, say that the images live here
>
> |---c:\myimages
> |-----------\app
> |-----------------\promotions
> |-------------------------\images
>
> & my app is under
>
> |---c:\tomcat5.5
> |----------\webapps
> |--------------------\myapp.
>
> the img links are written out dynamically based on an init-param in the
> web.xml & javabeans.   the result is that i can get a valid path to the
> image resouce looking at the html, but cannot actually load the image.
>
> does anyone know if that's possible on the windows platform (win2k
> server)?
>
>
> thanks
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message