Restrict access to files with temporary status?
If a file has a Status of Temporary the file in the filesystem can still be accessed (say, when themake_unused_managed_files_temporary configuration value is set to true (default is 0) in the file.settings.yml config file and a file becomes unused).
Often, if unused managed files become temporary it's because an author has replaced a file used on a media item with a newer version. Often this new version corrects some defect in the original document and it is therefore undesirable to maintain public access to the older file.
If you're having Drupal garbage collect temporary files you may have a few hours in which that old file is publicly available until it is deleted on cron (depending on the value of temporary_maximum_age in file.settings.yml). I'm primarily thinking about hotlinks to the files or the external experiences of having files surfaced via search or AI.
Is there a smart way to ensure these temporary files aren't accessible? Perhaps having them moved to private file storage until they're deleted? Would love some feedback here – there's not a lot of advice available in this area of file/media management and I'm managing a library of 10k+ items.
[link] [comments]