You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Jessop <ma...@cs.york.ac.uk> on 2007/07/12 12:54:37 UTC

Large file transfer through tomcat?

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@cs.york.ac.uk


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


Re: Large file transfer through tomcat?

Posted by Jake Alley <ja...@yahoo.com>.
I've run into a problem with this.  If a session times out, and someone comes back to post say a wiki page that they've been working on, it causes a problem.  Is there any way of dealing with this?  Logging people off automatically obviously won't work, because that's what's effectively happening.  Longer session timeouts?  


Mark Thomas <ma...@apache.org> wrote:
The only exception to this case I can think of is when POSTing to a
page that requires FORM authentication. In this case the entire
original request will be saved during the auth process but there is a
fairly low (4K?) default limit on the size of that request.

Mark


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



       
---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.

Re: Large file transfer through tomcat?

Posted by Mark Thomas <ma...@apache.org>.
Mark Jessop wrote:
> 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.

Tomcat will stream the data to/from your Servlet. There will be some
small (few K) in memory buffers in the path for efficiency but nothing
approaching the entire file.

The only exception to this case I can think of is when POSTing to a
page that requires FORM authentication. In this case the entire
original request will be saved during the auth process but there is a
fairly low (4K?) default limit on the size of that request.

Mark


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