You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Andrew M (JIRA)" <ji...@apache.org> on 2007/10/03 23:27:50 UTC

[jira] Commented: (FILEUPLOAD-141) Remove FileItems if FileUploadBase.parseRequest() fails

    [ https://issues.apache.org/jira/browse/FILEUPLOAD-141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532260 ] 

Andrew M commented on FILEUPLOAD-141:
-------------------------------------

I also need this feature. I think it's important since common-fileupload users need to deal with these temporary files. I don't want to have to write some dodgy bash script to do this clean up on the server when it can be handled by the web application.

Can we make this issue a priority and get it pushed out in the next release? I'll be happy to help with testing.

I see some work has been done on this on the latest code base in the trunk. Why is it that temporary files are being deleted when the application is destroyed. Surely it would be better to clean up files at the end of every session?


> Remove FileItems if FileUploadBase.parseRequest() fails
> -------------------------------------------------------
>
>                 Key: FILEUPLOAD-141
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-141
>             Project: Commons FileUpload
>          Issue Type: Improvement
>    Affects Versions: 1.2
>         Environment: commons-fileupload is used for parsing multipart/form-data POST requests in servlets.
> OS: Linux
>            Reporter: Marcus Klein
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.