# Can we search and find the big attachments?

**URL:** https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778
**Category:** Support
**Created:** [10월 5, 2018, 6:19오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778 "2018-10-05T06:19:02Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [10월 5, 2018, 6:19오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/1 "2018-10-05T06:19:02Z")

</div>

Your see, the server I rented is not very bid. And I find people like to upload attachments in the discourse. I have already set the maximum size of the attachments, while still the discourse Backup file is still too big.

Is it possible that I can search for the big attachments(say bigger than 10 M) and I can delete the attachment.

---

<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: [10월 5, 2018, 6:20오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/2 "2018-10-05T06:20:14Z")

</div>

This would be a very useful canned [data explorer](https://meta.discourse.org/t/32566?silent=true) query @rishabh.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 5, 2018, 11:05오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/4 "2018-10-05T11:05:11Z")

</div>

If you’re OK with those links being broken, you can use the Unix find command to locate them in the uploads directory. Something like [https://superuser.com/questions/628217/use-find-to-find-and-delete-large-files-of-a-certain-type](https://superuser.com/questions/628217/use-find-to-find-and-delete-large-files-of-a-certain-type)

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [10월 5, 2018, 2:17오후 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/5 "2018-10-05T14:17:10Z")

</div>

Is the upload folder

```plaintext
/var/discourse/shared/standalone/uploads

```

There are 2 subfolders in the “upload” folder, can I just delete things in the 2 subfolders?

* * *

Anyway, I still fell it too “dangerous” to delete things in this way.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 5, 2018, 4:01오후 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/6 "2018-10-05T16:01:26Z")

</div>

> [@xiasummer](#):
>
> There are 2 subfolders in the “upload” folder, can I just delete things in the 2 subfolders?

Yes.

> [@xiasummer](#):
>
> Anyway, I still fell it too “dangerous” to delete things in this way.

You’re breaking things on purpose, here.

You can see what would happen like this:

`find /var/discourse/shared/standalone/uploads -type f -size +50000k -exec ls -lh {} \;`

That’ll just list the files.

I’d recommend that you just leave them. It’s probably not that much space.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [10월 5, 2018, 7:00오후 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/7 "2018-10-05T19:00:39Z")

</div>

I wouldn’t be so concerned about how much space they’re taking up without considering their potential usefulness.

For example, if a topic had been archived, unlisted and had not been visited in a long time (i.e. the chances anyone might still be interested in the attachment are extremely rare) then I guess it might be OK to delete them. It would probably only impact members that were using the forum for long term file storage.

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [10월 6, 2018, 2:42오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/8 "2018-10-06T02:42:41Z")

</div>

The word dangerous I mentioned is not I’m afraid of deleting the attachments, I’m actually afraid of miss deleting other files eapecially some system components that will kill the discourse system. If I can delete these attachments one by one, I will delete them.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [10월 6, 2018, 3:34오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/9 "2018-10-06T03:34:23Z")

</div>

Only uploads are in the uploads directory.

You’ll want to make a backup. 🙂

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [12월 24, 2018, 8:44오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/12 "2018-12-24T08:44:55Z")

</div>

The default query for it was added in [DEV: Add a default query for Top 50 Largest Uploads · discourse/discourse-data-explorer@931bbb6 · GitHub](https://github.com/discourse/discourse-data-explorer/commit/931bbb67a07a57965c3da8ca471ee2283eeb1f27) and it looks like this:

 ![Screenshot%20from%202018-12-24%2014-10-04](https://global.discourse-cdn.com/meta/original/3X/b/8/b85da2e33223641e69bf3ca5627109afc6054a72.png)

---

<div class="post-metadata">

### Author: ![rishabh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rishabh/32/179446_2.png) [@rishabh](https://meta.discourse.org/u/rishabh)
#### Post date: [1월 14, 2019, 11:25오전 UTC](https://meta.discourse.org/t/can-we-search-and-find-the-big-attachments/98778/14 "2019-01-14T11:25:16Z")

</div>


