commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17043] New: - Temporary upload files are not being deleted
Date Thu, 13 Feb 2003 15:04:11 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17043>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17043

Temporary upload files are not being deleted

           Summary: Temporary upload files are not being deleted
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: File Upload
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: faustas.zilinskas@wachovia.com


In my multipart form I have one simple form parameter and 3 "file" type
parameters.
When I upload and parse it with Fileupload, 4 files get created.

After I'm done with the request,
I'm calling FileItem.delete() for all of them, but only three files get
deleted: the one that contains the simple form
parameter doesn't get deleted. When I try to delete it manually, I get
"Sharing violation error", which means
that there is another process who has the file open. Only after I
shutdown the JVM I can delete the file.

In order to solve the problem, all I did was to add fis.close() in the
DefaultFileItem.get():
                 try
                 {
                     FileInputStream fis = new FileInputStream(storeLocation);
                     fis.read(content);
                     --->fis.close();<---
                 }
                 catch (Exception e)
                 {
                     content = null;
                 }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message