commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Rose <>
Subject Re: [FileUpload] Large file uploads are slow
Date Sat, 11 Mar 2006 09:39:22 GMT
Hi again

>> I am using a DiskFileItemFactory, and the only thing I do to it is
>> mandate that the ServletFileUpload object created by the factory does
>> not have a limit on the size of the file being uploaded. The  
>> transfer is
>> going via HTTPS.
> I'm a little confused by this.


Sorry---it was a Friday and I was tired; here's a snippet:

                 DiskFileItemFactory factory = new DiskFileItemFactory 
                 ServletFileUpload upload = new ServletFileUpload 
                 upload.setSizeMax(-1); // No maximum upload size.
                 List fileItems = upload.parseRequest(request);

Then later I write the uploaded data to disk using fileItem.write 
(File). As I said in my original email, it's parseRequest() that  
takes a long time.

> Second, an unlimited file size is the default, so you
> shouldn't be configuring anything if that's what you want.

I added that code in case the default changes at a later date and to  
make it explicit in the code that there is no maximum file size.

So, is it possible to make an upload go faster? 20 seconds is an  
awfully long time...

Thanks again,


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

View raw message