Steps: with asset storage on the default local legacy storage (bucket = PATH_PUBLIC), upload a user avatar or background.
Expected: the temp files in sys_get_temp_dir() are removed after the upload.
Actual: av_* and bkg_* (plus .md) files stay in /tmp forever.
Cause: in User::uploadPicture(), the image is created in dirname(Upload::getTempNam()) and sent with AssetStorage::uploadFiles(). For local storage, LocalStorage:: put() uses copy(). The cleanup that unlinks the temp files only runs inside if (! AssetStorage::isLocalLegacy()), so in local legacy mode nothing removes the originals in /tmp.
Expected: the temp files in sys_get_temp_dir() are removed after the upload.
Actual: av_* and bkg_* (plus .md) files stay in /tmp forever.
Cause: in User::uploadPicture(), the image is created in dirname(Upload::getTempNam()) and sent with AssetStorage::uploadFiles(). For local storage, LocalStorage:: put() uses copy(). The cleanup that unlinks the temp files only runs inside if (! AssetStorage::isLocalLegacy()), so in local legacy mode nothing removes the originals in /tmp.
