Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-1323

Fileupload does not delete temporary file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Critical Critical
    • None
    • 6.0.1
    • None
    • Red Hat Enterprise Linux 6

      I added the "upload" attribute to a button that I have on a page. I've been watching the /tmp directory on my server and it continues to fill up with upload_*.tmp files. The temp files in there continues to increase, it never decreases. So I started reading the Apache Commons FileUpload library documentation and going through the ZK source code. I traced the code to the AuUploader class. In the AuUploader file is defined a private ItemFactory that extends from DiskFileItemFactory. According to the documentation for DiskFileItemFactory it defaults to having no FileCleaningTracker instance, so the temporary files will never be deleted.

      It looks to me like you will need to set the FileCleaningTracker for the servlet context using the FileCleanerCleanup.setFileCleaningTracker() and then in AuUploader you'd need to do something like this:
      [code]
      ItemFactory fty = new ItemFactory(...);
      fty.setFileCleaningTracker(FileCleanerCleanup.getFileCleaningTracker(context));
      [/code]

      The buildup of temporary files is really getting to be a problem. Please fix this. Thanks.

            Hudson Hudson (Inactive)
            iwagner iwagner
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: