File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes how to access images that are not in war file??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "how to access images that are not in war file???" Watch "how to access images that are not in war file???" New topic
Author

how to access images that are not in war file???

Rajan Punchouty
Greenhorn

Joined: Mar 15, 2004
Posts: 21
Hi,
I have upload directory for images on my hard disk. I want to access them in HTML image tag. how to access them with respect to application context. As example C:/upload has images and i put my war file in C:/tomcat/webapps.
Thanx in advance,
Rajan
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
There are two possibilities:
1. Put the image files where the web server is allowed to serve from - which would be under tomcat/webapps/somecontext and use a src in the image tag that points to that directory. Note that the web server will not normally be allowed to serve files from C:/upload
2. Serve the images via a servlet - in which case the src will have to point to the servlet and include the image file nam.
Bill


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to access images that are not in war file???
 
Similar Threads
Serving Up Image Outside of Root
Cannot login into tomcat
My webhosting company asked me to rename my .war file into ROOT.war
How to acess file outside a War file.
Deploying WAR files on a shared host?