Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Large file transfer through tomcat?

Mark Jessop

2007-07-12

Replies:

Hi,

I am putting together a site that allows files stored in an external system
to be uploaded/downloaded via http. This works absolutely fine, but I am
concerned as to what might happen if a user attempts to up/down load
gigabyte files.


My question is, what happens inside tomcat in these cases, does it buffer
all data in memory or is it cached on disk?

For upload, I have a servlet that reads off the file data, and then connects
to the storage system and sends the file. In an ideal world I would like
the servlet to be able to stream data directly off the http socket into the
storage system socket.

For download, a servlet connects to the storage system and extracts file
data, returning it to the client browser, which then saves it as a file.
Again I would like to forward data directly from the storage system socket
to the http socket.

In both of these cases, I don't want to have to hold the entire file in a
memory buffer before it can be managed.

Thanks for your help.

Mark.

Mark Jessop
Carmen Project
The University of York, Dept. of Computer
Science, Heslington, York, Y010 5DD
Tel  : +44 (0)1904 567712 (727712 internal)
Web  : http://www.carmen.org.uk
E-mail: mark.jessop@(protected)


---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.