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

Fileupload does not delete temporary file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Red Hat Enterprise Linux 6

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            Hudson Hudson
            Reporter:
            iwagner iwagner
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: