I'm running into an exceedingly strange problem. I'm using commons-fileupload
(1.2.1) to process file uploads in my webapp (hosted in tomcat 7.0.23, and the distributable
flag is set). Once I get a DiskFileItem
instance from my DiskFileItemFactory
(no FileCleaningTracker
), I use its write
method to store the file (in the same directory that the DiskFileItemFactory
was configured to use in case it needed to write the file to disk as it streamed in). The problem is that this new file (explicitly created and named by me) is then deleted after the request finishes processing. As you can imagine, this is problematic when I need to access the file again.
Tidbits that seem like they might be relevant:
chmod a-w
the file before the request finishes, it still gets deleted when the request finishes.Thanks for any help.
And the culprit? A stray finalize
method from 9+ years ago doing "cleanup".