Struts 2
  1. Struts 2
  2. WW-3801

FileUploadInterceptor does not clean up temporary files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3, 2.3.1.2
    • Fix Version/s: 2.3.4
    • Component/s: Core Interceptors
    • Labels:
      None
    • Environment:

      JDK 1.6.0_31, Tomcat 7.0.25

      Description

      In WW-3490, it solved "clean up exception" issue.
      then clean up code went to FilterDispatcher.
      but FilterDispatcher is deprecated.

      I usually use StrutsPrepareAndExecuteFilter.
      in that case temporary file was not removed.

      I found another problem(move to WW-3802).
      I uploaded file with cgi parameters.
      cgi parameter became a temporary file,
      and those files were not removed.

      for example ...

      <form action="..." method="post" enctype="multipart/form-data">
      <input type="file" name="uploadFile" />
      <input type="text" name="data1" value="FOO"/>
      <input type="text" name="data2" value="BAR"/>
      </form>

      remained tmp file

      [upload_47c7ddf7_136bf8a8b3b__8000_00000002.tmp]
      FOO

      [upload_47c7ddf7_136bf8a8b3b__8000_00000003.tmp]
      BAR

        Activity

        Hide
        Lukasz Lenart added a comment -

        Even if you used FilterDispatcher ? And please address one problem per issue, it's much more easy to handle discussion and solution.

        Show
        Lukasz Lenart added a comment - Even if you used FilterDispatcher ? And please address one problem per issue, it's much more easy to handle discussion and solution.
        Hide
        macha64 added a comment -

        I used FilterDispatcher,
        upload file was removed.
        but cgi parameter tmp file were not removed.

        I created WW-3802 for cgi parameter tmp file issue.

        Show
        macha64 added a comment - I used FilterDispatcher, upload file was removed. but cgi parameter tmp file were not removed. I created WW-3802 for cgi parameter tmp file issue.
        Hide
        Lukasz Lenart added a comment -

        Ok, thanks! So basically, the problem is with the new filters which don't clean up uploaded files as FilterDispatcher is doing.

        Show
        Lukasz Lenart added a comment - Ok, thanks! So basically, the problem is with the new filters which don't clean up uploaded files as FilterDispatcher is doing.
        Hide
        Lukasz Lenart added a comment -

        Done, please test with the latest snapshot!

        Show
        Lukasz Lenart added a comment - Done, please test with the latest snapshot!
        Hide
        Hudson added a comment -

        Integrated in Struts2 #462 (See https://builds.apache.org/job/Struts2/462/)
        WW-3801 adds logic to clean ups uploaded files (Revision 1328528)

        Result = SUCCESS
        lukaszlenart :
        Files :

        • /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java
        Show
        Hudson added a comment - Integrated in Struts2 #462 (See https://builds.apache.org/job/Struts2/462/ ) WW-3801 adds logic to clean ups uploaded files (Revision 1328528) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ng/PrepareOperations.java

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            macha64
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development