Commons FileUpload
  1. Commons FileUpload
  2. FILEUPLOAD-141

Remove FileItems if FileUploadBase.parseRequest() fails

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2.2
    • Labels:
      None
    • Environment:

      commons-fileupload is used for parsing multipart/form-data POST requests in servlets.
      OS: Linux

      Description

      If the method FileUploadBase.parseRequest() throws a FileUploadException, the already parsed FileItem objects are not accessible and removed by the garbage collector. Now expect a fileupload that fills the servers hard disc with FileItems until no space is left on the device. The method parseRequest() throws a FileUploadException and there are several FileItem objects that still exist in the device because the garbage collector does not run and removes them. This causes failing fileuploads until the garbage collector runs and removes the lost FileItem objects. I suggest calling FileItem.delete() on all FileItem objects created in the method FileUploadBase.parseRequest() if the method is left with a FileUploadException.

        Issue Links

          Activity

          Thomas Neidhart made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 1.2.2 [ 12315238 ]
          Resolution Duplicate [ 3 ]
          Thomas Neidhart made changes -
          Link This issue duplicates FILEUPLOAD-160 [ FILEUPLOAD-160 ]
          Henri Yandell made changes -
          Resolution Won't Fix [ 2 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Jochen Wiedmann made changes -
          Field Original Value New Value
          Resolution Won't Fix [ 2 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Marcus Klein created issue -

            People

            • Assignee:
              Unassigned
              Reporter:
              Marcus Klein
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development