Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-102
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Jochen Wiedmann
Reporter: Sharmarke Aden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

[fileupload] FileUpload 2 gig File Size Limitation

Created: 20/Jan/06 07:49 AM   Updated: 09/Mar/07 08:32 PM
Return to search
Component/s: None
Affects Version/s: 1.1 Final
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Bug38323MultipartStream.java.patch 2006-01-20 08:20 AM Sharmarke Aden 0.7 kB
Environment:
Operating System: All
Platform: All

Bugzilla Id: 38323
Resolution Date: 04/Aug/06 08:40 PM


 Description  « Hide
Looking through the FileUpload 1.1 code it looks like there is a limitation on
how big of a file can be received and processed. If you look at the readBodyData
method of the MultipartStream class you'll notice that an integer is being used
to keep a tally of the total number of bytes received when processing an
encapsulation. I recommend changing the type of the variable "total" to a long
in the readBodyData and wherever a tally of bytes received is done.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Cooper added a comment - 20/Jan/06 08:01 AM
It's not quite that simple. The content length provided by the container (either
servlet or portlet) is also an integer, so there is a limitation in the
containers themselves. (See Request.getContentLength and
ActionRequest.getContentLength.)

Sharmarke Aden added a comment - 20/Jan/06 08:20 AM
Created an attachment (id=17461)
total variable type changed from int to long

Here is a patch that that resolves the limitation (I think). This patch simply
changes type of the total variable from int to long.


Sharmarke Aden added a comment - 20/Jan/06 08:31 AM
(In reply to comment #1)
> It's not quite that simple. The content length provided by the container (either
> servlet or portlet) is also an integer, so there is a limitation in the
> containers themselves. (See Request.getContentLength and
> ActionRequest.getContentLength.)

Wow, I guess I never noticed that that Request.getContentLength returns an
integer. Still, the spec allows for getContentLength to return -1 (unknown
length) therefore the length of the content sent can be greater than 2 gig.


Henri Yandell made changes - 16/May/06 10:05 AM
Field Original Value New Value
issue.field.bugzillaimportkey 38323 12342868
Henri Yandell made changes - 16/May/06 11:35 AM
Component/s FileUpload [ 12311116 ]
Key COM-2716 FILEUPLOAD-102
Affects Version/s 1.1 Final [ 12311652 ]
Project Commons [ 12310458 ] Commons FileUpload [ 12310476 ]
Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
Henri Yandell made changes - 16/May/06 12:06 PM
Affects Version/s 1.1 Final [ 12311751 ]
Jochen Wiedmann added a comment - 04/Aug/06 08:40 PM
1.2 allows to set the limit to -1 (aka no limit), in which case the file size is unlimited.

Jochen Wiedmann made changes - 04/Aug/06 08:40 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Assignee Jochen Wiedmann [ jochen@apache.org ]
Fix Version/s 1.2 [ 12311929 ]
Henri Yandell made changes - 09/Mar/07 08:32 PM
Status Resolved [ 5 ] Closed [ 6 ]