When uploading multiple temporary files in a single request, only one file is eventually cleaned up automatically.
The tempDir variable in getForm is reassigned for each uploaded file, but the finalizer closure only remembers the last assigned tempDir. Each file is placed in a different temporary directory, but the cleanup logic will only delete one of them.
When uploading multiple temporary files in a single request, only one file is eventually cleaned up automatically.
The
tempDirvariable ingetFormis reassigned for each uploaded file, but thefinalizerclosure only remembers the last assignedtempDir. Each file is placed in a different temporary directory, but the cleanup logic will only delete one of them.