File Reference and Deletion, will it really be deleted?

(xiasummer) #1

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="//">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?

(Rafael dos Santos Silva) #2

If 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.

(Dean Taylor) #3

Consider setting up:

(Felix Freiberger) #4

Does this also affect attachments referenced in deleted posts?

(Vinoth Kannan) #5

Yes. If a post completely deleted and removed from database and it’s attachments not referenced anywhere else then it will be removed.

(Felix Freiberger) #6

…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?

(Vinoth Kannan) #7

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) #8

Hi @vinothkannans

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?


(Vinoth Kannan) #9

Also there are many other related topics.

(Ismael Posada Trobo) #10

Yes, exactly, that’s what I was looking for :ok_hand:

Thank you very much!