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:
try file.csv (6 字节)
with codes to be
<a class="attachment" href="//assets-meta-cdck-prod-meta.s3.dualstack.us-west-1.amazonaws.com/original/3X/f/8/f8c1d87006fbf7e5cc4b026c3138bc046883dc71.csv">try file.csv</a>
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?
May 11, 2017, 4:34pm
clean up uploads is enabled, all uploads not referenced in posts will be removed after
clean orphan uploads grace period hours.
If space is a problem, isn’t 100MB files a little too much? 5 or 10MB is enough most times.
May 12, 2017, 9:56am
Does this also affect attachments referenced in deleted posts?
Yes. If a post completely deleted and removed from database and it’s attachments not referenced anywhere else then it will be removed.
May 12, 2017, 12:05pm
…so that means that “deletion” in the UI or editing the post so only an old revision contains the link is
not enough to get a file removed, right?
From my understanding of the current code
If admin can see a post even after deletion (in soft delete or hidden mode) then it means post is not deleted in db. Then it will not removed.
In this case the media will be removed.
(Ismael Posada Trobo)
July 23, 2018, 6:24pm
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?
Say I drop an image in a post and some time later I decide to remove it by editing the post and erasing the markdown image link.
Does the file get deleted from the server after some time?
If not, is there any way I can do that manually as a regular user?
Also there are many other related topics.
(Ismael Posada Trobo)
July 26, 2018, 12:08pm
Yes, exactly, that’s what I was looking for
Thank you very much!
January 19, 2021, 11:31pm
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.