A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Node.js in Action
this week in the
How to acess file outside a War file.
Joined: Aug 12, 2009
Oct 31, 2011 03:01:32
When users upload images, I am saving it to an external folder(outside deployed WAR file). I need some way by which i can access these files and display it on the webpage. How can this be done.
Joined: Jul 05, 2008
Oct 31, 2011 05:16:11
The user uploaded files can be displayed in a web page using servlet/jsp by reading the physical file (
etc). Then the bytes of the read stream can be written into the output stream of
to display the read files in web page.
in = new
("absoulte path name"));
No pain, No gain.
Joined: Jul 14, 2010
Oct 31, 2011 08:30:43
Just be sure to release the file after you read it. Or your app will have a lot of memory problems.
Full WebApplication JSF EJB JPA JAAS with source code to download
One Table Per SubClass
It is sorta covered in the
JavaRanch Style Guide
subject: How to acess file outside a War file.
Can't deploy war file outside of [tomcat]/webapps
how to deploy?
best place to put configuration properties.
WAS 5.1 Classloaders
how many portlet I can put in one *. war file
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014