In a discussion titled “File Reference and Deletion, will it really be deleted?”, users explore how Discourse handles file deletion and storage management. xiasummer expresses concern about storage limits on a small 20GB server and asks whether removing file references from posts (e.g., deleting HTML link code) will actually delete the file and reduce backup size. Falco clarifies that if “clean up uploads” is enabled, unreferenced files are deleted after a grace period, and suggests reducing the max upload size from 100MB to 5–10MB. DeanMarkTaylor recommends using S3 for offloading uploads. fefrei asks whether files referenced in deleted posts are removed; vinothkannans confirms that if a post is fully deleted from the database and its attachments are unreferenced elsewhere, they will be removed. fefrei clarifies that UI deletion or editing (leaving link only in old revisions) doesn’t suffice — vinothkannans explains that if a post is soft-deleted or hidden, it’s not removed from the DB, so attachments remain; however, if only an old revision contains the link, the file will be removed. trobiyo asks whether attachments are deleted when posts/topics are deleted via UI in v2.0.2+; vinothkannans links to a related topic do-unlinked-files-get-auto-deleted/92215 for further details. sbernhard asks about deletion of files in private messages and suggests a “self-destructing” private message feature. The consensus is that files are only deleted if unreferenced and the post is fully removed from the database — not merely edited or soft-deleted.
I have a small server with only 20G of storage with my Discourse running on it. So I can’t let people upload too big files——of course if it is very important it should still be uploaded, but if not so important, it should not.
So I set the biggest upload file size 100M.
But I see many not so important files uploaded and the back-up quickly increases.
Here is a really small file I uploaded as an example:
What if I just delete such codes. Will the file “try file.csv” really be deleted from the server and will not cause any more burden on Discourse Backup File?
Could you please confirm that, in the latest versions (v.2.0.2 and so), when an administrator deletes topics/posts with attachments from UI, either individually or in bulk, those attachments are never removed from the server?
In case they aren’t, what’s the best approach to totally removed from server?
when are uploaded files to private messages are deleted?
Additionally, it would be great to have something like a “self-destroying” private message which will delete the sender and receiver message including the attached files after X hours /days.