tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asingla4 <mrakashsin...@gmail.com>
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
System.

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
refreshed/restarted.
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.

Thanks
Akash Singla
http://www.TheDaedals.com 
-- 
View this message in context: http://www.nabble.com/Unable-to-view-uploaded-files-in-Tomcat-till-server-is-refreshed-tp25212993p25212993.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Mime
View raw message