tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asingla4 <>
Subject Unable to view uploaded files in Tomcat till server is refreshed
Date Sun, 30 Aug 2009 16:17:28 GMT

Hi All,

I am building an application wherein the user would have an option to upload
files (can be documents or images) and once the files are uploaded the user
should be able to download it.

I am using Apache Tomcat 6.0 and JDK1.6.
Every thing seems to be OK for the File Upload part but I have some
questions in my mind for the File Download Part.

Approach 1:
Initially I tried to use the BLOB feature of the mysql Database to save the
file as a Binary stream in the DB. However after googling it out I found out
that there are serious performance issues with BLOB (The file size can be
anywhere from 1 KB to 20 MB). Thus we have ruled out this approach.

Approach 2:
We decided to save the file path in the DB and save the file to the File

For this, Initially we stored the files under the Root directory of the
application but the Tomcat could not recognize the files until it was
This can’t be accepted for the realtime environment.
One fix we found out for this was to create a new file directory under the
web-apps folder of tomcat outside the root directory of the application and
save the files in this directory. To make this work we added a new context
to the tomcat configuration.

Please suggest if this is the best approach to follow.

Akash Singla 
View this message in context:
Sent from the Tomcat - User mailing list archive at

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

View raw message