Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330233

Summary: [Upload] Temporary files are not deleted
Product: [RT] RAP Reporter: Oliver B. <oliver>
Component: IncubatorAssignee: Project Inbox <rap.incubator-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse
Version: 1.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch with auto-delete on reset/dispose none

Description Oliver B. CLA 2010-11-15 07:16:04 EST
While testing the upload widget, I found out that the underlying apache library creates temporary files for bigger uploads. These files are created in the local temp directory of the server.

In some cases these files are never deleted to the point that my harddrive was full (testing with big files).

This is reproduceable with the upload demo. In some cases the files are deleted. But most of the time they are never deleted even after the shutdown of the server.

From my understanding these temp files should be deleted automatically by the gargabe collector after there is no more reference to it.

I made a patch which deletes the temporary files after a reset/dispose of the upload-widget.
Comment 1 Oliver B. CLA 2010-11-15 07:16:58 EST
Created attachment 183116 [details]
Patch with auto-delete on reset/dispose
Comment 2 Ralf Sternberg CLA 2011-10-10 17:50:52 EDT
The upload widget is obsolete and will be removed in the future. Use the new FileUpload widget or the FileDialog implementation from the incubator instead.

Actually, this issue also exists with the new DiskFileUploadReceiver. Anyway, how should the framework decide when to cleanup files? Instead of adding cleanup functionality to this default implementation, we'd rather leave the decision to the user. With the new design, you can provide your own FileUploadReceiver that cleans up files after a certain interval.