I wanted to know how to delete files when we don’t want them. Like sometimes users upload large size files and upload multiple copies of the same file. How can I delete the repeatedly uploaded items and keep my disk space clean? We run a blogging community forum at http://ask.mybloggertricks.com and we often need to upload graphic images and some css files
There is no way to delete files from the UI currently.
There is a cleanup task that automatically removes images which are no longer referenced in any Discourse post. It’s something @zogstrip added a year+ ago.
That is weird but at least I am glad the cleanup task exists. Images and uploaded files are an important part of community activity and there should have been a better control system for it.
Why is it weird? If an image is not displayed in any posts, why should it exist in the filesystem? Who will view it, and how?
You are right for images but what about js files. We sometimes need to host files at our forum and then link to them from </head> tag
That’d be a very risky use of uploads, since you would be allowing all users to upload javascript files that your site would then execute.
I … can’t … say I would recommend that.
That is right but we upload the js ourselves and have not given rights to anyone else. We disable the js upload as soon as we are done uploading some front-end js files.
Then make sure a hidden staff post links to the files. (There is a private staff category in every install.) And you should be fine.
I have just one new question in mind that is troubling me.
How does Discourse handles illegal hosting done by users using the PM system? What if a user uploads large files via PM and then links to it from an external source. Will cleanup task delete them or not?
Good question! Illegal activity in Messages is another reason admins need visibility into them, cc: @downey.
There is not a way at the moment to browse the largest file uploads but that would be a good thing to have eventually.
I am glad you agreed here. I will be more than pleased to have this option added in future updates 
“Illegal” is going to depend on the jurisdiction. For example, in the United States, the Online Copyright Infringement Liability Limitation Act provides safe harbor for service providers (such as someone running a Discourse site) against actions of their users. As long as the service provider responds to notice of infringing activity, and can produce good records of what that user did or did not do (emphasis hint for @codinghorror), and how they responded to that user and that user’s infringing content, then they are generally not liable for those actions.
In other words, it may not (or may, depending on where you are) be the job of the service provider to police and snoop on its users’ activities.
Sure, Nginx or Apache server logs would exist in all cases for all websites. So you are covered. This is real basic web stuff.
Whether the uploads are illegal or not, the site owner might not appreciate a user who signs up, achieves trust level 1 (necessary to message at all) and then posts 1 GB of files per day in PMs.
Still no such feature? How can I remove uploaded image?
Uploaded files that aren’t used anywhere are automatically removed.
Are you talking about an image that is used somewhere?
This are a good news, thank you. Can I delete 'em manually?
توضيحًا لتجنب أي لبس، عند تعديل منشور وإزالة الصورة الوحيدة المرتبطة بصورة Dropbox في أي مكان، هل تُصنف هذه الصورة على أنها غير مستخدمة في أي مكان؟ حاليًا، يمكن عرضها عند مراجعة سجل التعديلات، وهو أمر لم أكن أتوقعه.
هذان شيئان مختلفان.
الصورة التي تم تحميلها تحتوي على سجل Upload في قاعدة البيانات.
أما “الصورة المرتبطة بـ Dropbox” فهي رابط لصورة يتم “تقديمها” للعملاء (المتصفحات) بواسطة Dropbox.
التنظيف الآلي يتعلق فقط بالصور التي تم تحميلها، وليس بالصور المرتبطة.
إذن، سيتم حذف الصورة تلقائيًا إذا كان لديها سجل upload لم يتم نشره فعليًا أو تم حذفه من تعليق. هل هذا صحيح؟
edited.png
صورة الـ png أعلاه قادمة من رابط Dropbox. كانت تجربتي السابقة مع ملف .gif هي أنه عند حذف الرابط الأساسي، استمرت الصورة في الظهور داخل التعليق. وإذا قمت بتحرير المنشور وأزلت الرابط، استمرت الصورة في النسخة الأصلية من المنشور. سيتم تحرير هذا المنشور، لذا آمل أن يوضح ما أعنيه!
لا يبدو أن هذا يتم “تقديمه” (served)، بل يبدو أنه يتم “تحميله” (uploaded). أليس الأمر كذلك؟
تعديل رقم 2
-
لقد حذفت الرابط من جانب Dropbox وتوقف عن الظهور فورًا في المنشور.
-
أعيدت تفعيل الرابط، وبدلاً من ذلك قمت بتحرير المنشور لإزالة الرابط، ولكن في متصفح آخر لم أتمكن من عرض التعديلات السابقة للمنشور - لا توجد أيقونة قلم - لاختبار هذا:
إذا قمت بتحرير المنشور وأزلت الرابط، استمرت الصورة في النسخة الأصلية من المنشور.
السلوك المذكور في النقطة الأولى يتعارض مع المنشور هنا، فإذا نظرت إلى سجل التعديلات الأول في المنشور، ستجد ملف .gif. الرابط الأساسي لا يعمل والمنشور لم يعد يحتوي عليه، لذا أنا مشوش بسبب الاختلافات هنا وهناك.