You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "jagub zhang (JIRA)" <ji...@apache.org> on 2012/05/16 07:50:12 UTC

[jira] [Comment Edited] (WW-3802) FileUploadInterceptor makes CGI Parameter temporary files

    [ https://issues.apache.org/jira/browse/WW-3802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13276474#comment-13276474 ] 

jagub zhang edited comment on WW-3802 at 5/16/12 5:48 AM:
----------------------------------------------------------

I have test the build, and found a mistake about JakartaMultiPartRequest.java.
You add [ item.delete(); ] at line 124 method processFileField, but the method is parse file field.
I think the [ item.delete(); ] should add into method processNormalFormField.


About mismatch with dependencies:
I just have another old project which is started 2 years ago (struts 2.1.8).
and found The cgi tmp files will be deleted soon. then I replace commons-fileupload-1.2.1.jar
, commons-io-1.4.jar into struts 2.3.4 project, it worked successfully.

PS: only fileupload-1.2.1 and io-1.4 combination can do it, I only want to know why?
                
      was (Author: jagub.zhang@gmail.com):
    I have test the build, and found a mistake about JakartaMultiPartRequest.java.
You add [ item.delete(); ] at line 144 method processFileField, but the method is parse file field.
I think the [ item.delete(); ] should add into method processNormalFormField.


About mismatch with dependencies:
I just have another old project which is started 2 years ago (struts 2.1.8).
and found The cgi tmp files will be deleted soon. then I replace commons-fileupload-1.2.1.jar
, commons-io-1.4.jar into struts 2.3.4 project, it worked successfully.

PS: only fileupload-1.2.1 and io-1.4 combination can do it, I only want to know why?
                  
> FileUploadInterceptor makes CGI Parameter temporary files
> ---------------------------------------------------------
>
>                 Key: WW-3802
>                 URL: https://issues.apache.org/jira/browse/WW-3802
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.3.1.2
>         Environment: JDK 1.6.0_31, Tomcat 7.0.25
>            Reporter: macha64
>            Assignee: Lukasz Lenart
>            Priority: Minor
>             Fix For: 2.3.5
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> I uploaded file with cgi parameters.
> CGI parameter became a temporary file,
> and those files were not removed.
> FileUploadInterceptor makes not only upload file
> but also CGI Parameter temporary files.
> CGI Parameter temporary files are 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 files.
> [upload_47c7ddf7_136bf8a8b3b__8000_00000002.tmp]
> FOO
> [upload_47c7ddf7_136bf8a8b3b__8000_00000003.tmp]
> BAR

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira