Assets 'tmp_upload' folder is not cleaned when a file is uploaded via Website Browser
Steps to reproduce:
-
Go to Website Browser.
-
Add a new File/Image asset on any folder.
-
Take a look at DOTCMSHOME/dotCMS/assets/tmpupload/loggedinuserId/binary1/ folder. The file is temporarily placed there and then a folder is created inside of it, e.g.
DOTCMSHOME/dotCMS/assets/tmpupload/loggedinuserId/binary1/UUID/ folder
-
The asset is copied to this new folder.
-
The asset inside the new folder DOTCMSHOME/dotCMS/assets/tmpupload/loggedinuserId/binary1/UUID/ is moved to the regular asset folder and the content is saved.
-
The original asset placed here DOTCMSHOME/dotCMS/assets/tmpupload/loggedinuser_id/binary1/ is never deleted. Also, the temp folder created on step 3 is not deleted, although this one is already empty.
All these steps are part of the regular procedure defined in code, but the tmp_upload folder should be cleaned because it may contain a large amount of assets that are already saved.
Reproduced locally in master and in TRF 2.5 Box.
Jose this happens later in the night looking for the code now.
also we try hard to don't duplicate the file and do a hard link instead
Yup this class com.dotmarketing.quartz.job.BinaryCleanupJob
Thanks guys.