# Understanding how uploading images and files work

**URL:** https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419
**Category:** Support
**Created:** [9월 2, 2019, 3:36오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419 "2019-09-02T15:36:08Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![verilog15](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@verilog15](https://meta.discourse.org/u/verilog15)
#### Post date: [9월 2, 2019, 3:36오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/1 "2019-09-02T15:36:08Z")

</div>

Hello all! 🙂  
Due to storage limitations, I was wondering how uploading images/files work. As I understand, everytime, user uploads a new image to the forum, it saves it somewhere. The question is where exactly? Also, what if admin or user removes that image from the topic, will this image be removed from that storage area? (if it is, will it remove the image right away or will it wait for a period of time).  
Thank you 😛

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [9월 2, 2019, 3:38오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/2 "2019-09-02T15:38:51Z")

</div>

> [@verilog15](#):
>
> The question is where exactly?

At `/var/discourse/shared/standalone/uploads/default/` on the server.

> [@verilog15](#):
>
> if admin or user removes that image from the topic, will this image be removed from that storage area?

Yes as long as `clean up uploads` is enabled.

> [@verilog15](#):
>
> will it remove the image right away or will it wait for a period of time

Upload will be removed after `clean orphan uploads grace period hours`.

---

<div class="post-metadata">

### Author: ![verilog15](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@verilog15](https://meta.discourse.org/u/verilog15)
#### Post date: [9월 3, 2019, 4:46오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/3 "2019-09-03T16:46:05Z")

</div>

Thanks for explaining 🙂  
What if user will try to do some sort of “abuse” like upload bunch of images and remove each one after a few seconds. They all will be saved in the `../default` directory and I could ran out of storage?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [9월 3, 2019, 4:56오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/4 "2019-09-03T16:56:34Z")

</div>

Discourse new users can only upload one image per topic. Also image max size is just 4MB, so to fill a coupe of gigabytes a user will need a lot of images, and since we deduplicate uploads it will need to be all different. There is also `min trust to post images` that can be tweaked to TL2 if new accounts cause you problems.

If you can’t afford user uploads just disable them and tell your users to publish those in sites like [https://imgur.com/](https://imgur.com/) like Reddit did for years.

---

<div class="post-metadata">

### Author: ![verilog15](https://avatars.discourse-cdn.com/v4/letter/v/9f8e36/32.png) [@verilog15](https://meta.discourse.org/u/verilog15)
#### Post date: [9월 3, 2019, 5:01오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/5 "2019-09-03T17:01:52Z")

</div>

The 4MB limitation is also true of documents like PDF?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [9월 3, 2019, 5:07오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/6 "2019-09-03T17:07:49Z")

</div>

No, PDF aren’t images. Those are handled as files and follow the `max attachment size kb` site setting.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [10월 3, 2019, 5:07오후 UTC](https://meta.discourse.org/t/understanding-how-uploading-images-and-files-work/127419/7 "2019-10-03T17:07:52Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
