How do I clear the temporary file of uploaded files

As title, When I upload a file using the upload api( Files API :: Jmix Documentation) and leave the page without saving the form, the file will be saved on the server.

How do I clean up these unused or redundant files


Take a look into io.jmix.ui.upload.TemporaryStorageImpl#clearTempDirectory method.
It deletes old temporary files.
This method can be invoked periodically as a Quartz job.

Thank. The temp folder can clear.

But I have another question

In my case, This file will be saved directly to the fliestorage directory after upload file to server By files rest API (POST: http://localhost:8080/rest/files).

Is there a setting that can be adjusted to manual mode. like: FileStorageUploadField :: Jmix Documentation
When set the fileStoragePutMode attribute to the MANUAL value, The file will be stored in the staging area

TemporaryStorage is implemented only for Vaadin UI module.
Similar thing could not be for implemented REST API - because it cannot be clusterized, it stores files in the local file system.