# How to Delete Uploaded Files?

**URL:** https://meta.discourse.org/t/how-to-delete-uploaded-files/25001
**Category:** Support
**Created:** [09.Февраль.2015 07:53:55 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001 "2015-02-09T07:53:55Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Mohammad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohammad/32/115484_2.png) [@Mohammad](https://meta.discourse.org/u/Mohammad)
#### Post date: [09.Февраль.2015 07:53:55 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/1 "2015-02-09T07:53:55Z")

</div>

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](http://ask.mybloggertricks.com) and we often need to upload graphic images and some css files

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [09.Февраль.2015 08:14:49 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/2 "2015-02-09T08:14:49Z")

</div>

There is no way to delete files from the UI currently.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [09.Февраль.2015 08:39:57 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/3 "2015-02-09T08:39:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Mohammad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohammad/32/115484_2.png) [@Mohammad](https://meta.discourse.org/u/Mohammad)
#### Post date: [09.Февраль.2015 08:42:50 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/4 "2015-02-09T08:42:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [09.Февраль.2015 08:43:29 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/5 "2015-02-09T08:43:29Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Mohammad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohammad/32/115484_2.png) [@Mohammad](https://meta.discourse.org/u/Mohammad)
#### Post date: [09.Февраль.2015 08:57:28 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/6 "2015-02-09T08:57:28Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [09.Февраль.2015 10:13:51 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/7 "2015-02-09T10:13:51Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Mohammad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohammad/32/115484_2.png) [@Mohammad](https://meta.discourse.org/u/Mohammad)
#### Post date: [09.Февраль.2015 10:45:40 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/8 "2015-02-09T10:45:40Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [09.Февраль.2015 23:02:58 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/9 "2015-02-09T23:02:58Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Mohammad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohammad/32/115484_2.png) [@Mohammad](https://meta.discourse.org/u/Mohammad)
#### Post date: [28.Март.2015 19:55:59 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/10 "2015-03-28T19:55:59Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [28.Март.2015 21:31:31 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/11 "2015-03-28T21:31:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Mohammad](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mohammad/32/115484_2.png) [@Mohammad](https://meta.discourse.org/u/Mohammad)
#### Post date: [28.Март.2015 21:35:38 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/12 "2015-03-28T21:35:38Z")

</div>

I am glad you agreed here. I will be more than pleased to have this option added in future updates 😇

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [28.Март.2015 21:41:22 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/13 "2015-03-28T21:41:22Z")

</div>

> [@Mohammad](#):
>
> 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?

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

> **[Online Copyright Infringement Liability Limitation Act](https://en.wikipedia.org/wiki/Online_Copyright_Infringement_Liability_Limitation_Act)**
>
> The Online Copyright Infringement Liability Limitation Act (OCILLA) is United States federal law that creates a conditional 'safe harbor' for online service providers (OSP), a group which includes Internet service providers (ISP) and other Internet intermediaries, by shielding them for their own acts of direct copyright infringement (when they make unauthorized copies) as well as shielding them from potential secondary liability for the infringing acts of others. OCILLA was passed as a part of ...

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [28.Март.2015 21:43:50 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/14 "2015-03-28T21:43:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![maleficmax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maleficmax/32/97485_2.png) [@maleficmax](https://meta.discourse.org/u/maleficmax)
#### Post date: [25.Май.2018 12:11:19 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/15 "2018-05-25T12:11:19Z")

</div>

Still no such feature? How can I remove uploaded image?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [25.Май.2018 15:26:31 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/16 "2018-05-25T15:26:31Z")

</div>

Uploaded files that aren’t used anywhere are automatically removed.

Are you talking about an image that is used somewhere?

---

<div class="post-metadata">

### Author: ![maleficmax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maleficmax/32/97485_2.png) [@maleficmax](https://meta.discourse.org/u/maleficmax)
#### Post date: [25.Май.2018 16:17:46 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/18 "2018-05-25T16:17:46Z")

</div>

This are a good news, **thank you**. Can I delete 'em manually?

---

<div class="post-metadata">

### Author: ![anon47420739](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anon47420739](https://meta.discourse.org/u/anon47420739)
#### Post date: [01.Октябрь.2020 04:49:01 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/19 "2020-10-01T04:49:01Z")

</div>

Для избежания двусмысленности: если при редактировании поста удалена единственная ссылка на изображение или изображение из Dropbox, считается ли это изображение неиспользуемым нигде? В настоящее время оно отображается при просмотре истории изменений, чего я не ожидал.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [01.Октябрь.2020 07:35:57 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/20 "2020-10-01T07:35:57Z")

</div>

> [@anon47420739](#):
>
> изображение или изображение, связанное с Dropbox

Это два разных понятия.

Загруженное изображение — это файл, который был загружен и имеет запись `Upload` в базе данных.

«Изображение, связанное с Dropbox» — это ссылка на изображение, которое «предоставляется» клиентам (браузерам) через Dropbox.

Автоматическая очистка касается только загруженных изображений, а не связанных.

---

<div class="post-metadata">

### Author: ![anon47420739](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@anon47420739](https://meta.discourse.org/u/anon47420739)
#### Post date: [01.Октябрь.2020 23:19:13 UTC](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001/21 "2020-10-01T23:19:13Z")

</div>

Итак, изображение с записью `upload`, которое никогда не было опубликовано или было удалено из комментария, автоматически удаляется. Это верно?

edited.png

Приведённый выше PNG-файл загружен по ссылке Dropbox. По моему предыдущему опыту с .gif-файлами: при удалении исходной ссылки изображение всё ещё отображалось в комментарии. Если я редактировал пост и удалял ссылку, изображение сохранялось в первоначальной версии поста. Этот пост будет отредактирован, поэтому надеюсь, что это проиллюстрирует, что я имею в виду!

Кажется, это изображение не «обслуживается», а загружается. Разве не так?

* * *

Редактирование #2

1. Я удалил ссылку на стороне Dropbox, и изображение сразу перестало быть доступным для просмотра в посте.

2. Я снова включил ссылку, но вместо этого отредактировал пост, удалив ссылку. Однако в другом браузере я не смог просмотреть предыдущие версии поста — там нет значка карандаша — чтобы проверить следующее:  
_Если я редактировал пост и удалял ссылку, изображение сохранялось в первоначальной версии поста._

Поведение, описанное в пункте 1, противоречит посту [здесь](https://community.signalusers.org/t/bug-no-full-screen-video-controls-in-4-70-5-android-11/16709). Если вы посмотрите историю редактирования первого поста, то увидите .gif-файл. Исходная ссылка больше не работает, и пост её больше не содержит, поэтому я сбит с толку различиями между этими случаями.

[Следующая страница](https://meta.discourse.org/t/how-to-delete-uploaded-files/25001.md?page=2)
