Commons FileUpload
  1. Commons FileUpload
  2. FILEUPLOAD-168

read form field parameters even if maxSize has been exceeded

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      commons fileupload 1.2.2-SNAPSHOT

      Description

      Hi!

      This issue is similar to FILEUPLOAD-140. I can't seem to reopen it so I created a new one instead. FILEUPLOAD-140 was marked as resolve by using the streaming API, if I'm not mistaken. No change was done. But I disagree on the resolution of simply using the streaming API (as detailed in http://commons.apache.org/fileupload/streaming.html).

      First of all, I tried to upload a big file exceeding maxSize with streaming API and got the SizeLimitExceededException even before ANY parameter has been read.

      ServletFileUpload.getItemIterator() calls FileUploadBase.getItemIterator() which creates a new FileItemIteratorImpl(). In the constructor code of FileItemIteratorImpl, it already checks for the requestSize and throws SizeLimitExceededException if sizeMax is exceeded.

      I'd like to open this discussion again and hope that in the end, we can have either:

      • form field parameters BEFORE the file parameter will still get read if requestSize is greater than sizeMax and then terminate once we reach the file
      • all form field parameters will still get read if requestSize is greater than sizeMax. But, we should skip reading the body of the files and proceed to the next 'boundary' so as not to keep the user waiting, if ever this is possible. (preferred)

      Then, we should also apply the same improvement into PortletFileUpload.

      1. fileupload1.patch
        2 kB
        Paul Rivera
      2. fileupload2.patch
        4 kB
        Paul Rivera

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jochen Wiedmann
            Reporter:
            Paul Rivera
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development