files/tmp folder usage

For one of our applications there is a lot of data (31G) in the data/files/tmp folder. This goes back as far as 2012(!). My question is when should this folder be cleaned up, why isn't this happening now and is it save to delete the content in this folder? Any tips would be much appreciated.
2 answers

The files in the temp folder contain among others the System.FileDocument entity where DeleteAfterDownload is set to true. You can set this Boolean manually but it is also set for Excel and CSV exports. If those files never actually get downloaded, they won't be removed.

Just deleting the files will corrupt your database, perhaps you can just perform an xpath query on all System.FileDocument entities with this Boolean set to true and delete those in a microflow.

Of course it's also a good question to ask yourself why you have so many of them. However, the naming of the folder 'tmp' is not really a good description and I think we're moving towards a situation in the latest version where all System.FileDocument files are just in the regular files folder, regardless of the value of this Boolean.


AFAIK this folder is used by Mendix to store temporary files and it's safe to clean this folder. It should be cleaned automatically by Mendix, but I know there are some Mendix versions which are not cleaning the whole folder up. Maybe Mendix 3.3.10 is not doing this right. It's a temp folder, so you could delete the folder manually or with a script. You need to do this only when the app is not running.

I know it's fixed in newer Mendix versions, so you should consider migrating your project.