commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From C Rose <>
Subject Re: [FileUpload] Large file uploads are slow
Date Sat, 11 Mar 2006 10:19:50 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 Friday and I was a little fried. He's a snippet:

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

Later I use FileItem.write(File) to write the data to disk.

> First of all, the ServletFileUpload instance
> is created by you, not by the DiskFileItemFactory. That factory  
> creates
> FileItem instances. Second, an unlimited file size is the default,  
> so you
> shouldn't be configuring anything if that's what you want.

I only set the maximum size manually to make it explicit in the code  
what is intended, and to protect myself against changes to the API  
defaults in future versions (which I hope would be unlikely).

As I said in my original email, it's parseRequest() that takes a long  
time to complete---and it'd be great to find a way to speed it up.

Thanks again


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

View raw message