# האם ניתן להגדיל את מגבלת 1024000 KB על קובץ מצורף?

**URL:** https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367
**Category:** Self-hosting
**Created:** [25 בספטמבר,‏ 2020,‏ 1:52pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367 "2020-09-25T13:52:32Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![Alon1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alon1/32/197167_2.png) [@Alon1](https://meta.discourse.org/u/Alon1)
#### Post date: [25 בספטמבר,‏ 2020,‏ 1:52pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/1 "2020-09-25T13:52:32Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/c/d/cd3fa05cda365614f7ec6f93fbca4974decb16f0.png)

I’m using S3 for attachment storage so that can handle up to 160GB.  
I changed the nginx limit to 0 (unlimited)  
The app.yml param “upload\_size” is also set to 0

---

<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: [25 בספטמבר,‏ 2020,‏ 2:13pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/2 "2020-09-25T14:13:42Z")

</div>

> [@Alon1](#):
>
> I’m using S3 for attachment storage so that can handle up to 160GB.

We don’t upload straight into S3, it goes to your server first and the server sends it to S3. That means you don’t want a limit larger than you free disk space.

---

<div class="post-metadata">

### Author: ![Alon1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alon1/32/197167_2.png) [@Alon1](https://meta.discourse.org/u/Alon1)
#### Post date: [25 בספטמבר,‏ 2020,‏ 2:14pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/3 "2020-09-25T14:14:59Z")

</div>

Ok, I would like to set the limit to 10GB i have enough disk space. But how can I change the Discourse limit?

---

<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: [25 בספטמבר,‏ 2020,‏ 2:32pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/4 "2020-09-25T14:32:44Z")

</div>

You can overwrite the max using a custom plugin. You can use this one as an example:

[https://github.com/jomaxro/discourse-plugin-site-setting-override](https://github.com/jomaxro/discourse-plugin-site-setting-override)

---

<div class="post-metadata">

### Author: ![Alon1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alon1/32/197167_2.png) [@Alon1](https://meta.discourse.org/u/Alon1)
#### Post date: [25 בספטמבר,‏ 2020,‏ 5:44pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/5 "2020-09-25T17:44:38Z")

</div>

Thank you, I can confirm that the limit is gone with using this plugin and the settings:

```
files:
  max_attachment_size_kb:
    client: true
    default: 1024000
    max: 6144000

```

However, I have 2 problems:

1. Uploading a 2GB file uploads well until 100% and then fails with general pop up error.
2. Every time i try this the Discourse Docker grows 2GB in size and doesn’t clear it!! I’m nearly out of space.. how can I clear this?

---

<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: [25 בספטמבר,‏ 2020,‏ 5:48pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/6 "2020-09-25T17:48:58Z")

</div>

You’re going to be better off using a proper cloud drive service of your choice, and linking the files in Discourse topics.. Discourse isn’t intended as a large file storage tool.

---

<div class="post-metadata">

### Author: ![Alon1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alon1/32/197167_2.png) [@Alon1](https://meta.discourse.org/u/Alon1)
#### Post date: [25 בספטמבר,‏ 2020,‏ 6:06pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/7 "2020-09-25T18:06:02Z")

</div>

I am using S3 cloud storage. Nothing is supposed to be stored on Discourse itself.

---

<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: [25 בספטמבר,‏ 2020,‏ 6:09pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/8 "2020-09-25T18:09:08Z")

</div>

That’s not what I mean – I mean a _consumer_ cloud drive service like Google Drive, OneDrive, Dropbox, etcetera.

Regardless of how you do it, Discourse is not designed to handle large files.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [25 בספטמבר,‏ 2020,‏ 6:27pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/9 "2020-09-25T18:27:00Z")

</div>

Regardless of where the file ends up, Discourse isn’t intended to be a bulky file _upload_ mechanism either.

---

<div class="post-metadata">

### Author: ![Alon1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alon1/32/197167_2.png) [@Alon1](https://meta.discourse.org/u/Alon1)
#### Post date: [25 בספטמבר,‏ 2020,‏ 6:32pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/10 "2020-09-25T18:32:20Z")

</div>

I understand that it wasn’t intended to do that, but it would be a great feature for me and will increase user experience if they don’t have to go to some other service to upload and back to Discourse.  
So I hope you won’t take offence if I try to get it to work despite the fact that it wasn’t the intention of the original development.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [25 בספטמבר,‏ 2020,‏ 6:58pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/11 "2020-09-25T18:58:06Z")

</div>

The wonders of open source is that you’re free to tinker.

Likewise if something isn’t supported there are no guarantees that future changes to Discourse won’t render the tweaks you’re making today totally inoperable in the future.

---

<div class="post-metadata">

### Author: ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)
#### Post date: [23 ביולי,‏ 2021,‏ 1:05pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/12 "2021-07-23T13:05:02Z")

</div>

> [@codinghorror](#):
>
> Regardless of how you do it, Discourse is not designed to handle large files.

> [@Stephen](#):
>
> Regardless of where the file ends up, Discourse isn’t intended to be a bulky file _upload_ mechanism either.

I’m considering allowing large file uploads (could be 50mb, and its possible there could be bulk uploads through the api) on my site as well. Just trying to understand the concern here. If S3 is configured to handle large file uploads and storage, and the Discourse forum links to those files to display a download link to the users, is anyone able to provide more detail about where you expect Discourse to have problems?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [26 ביולי,‏ 2021,‏ 5:52am UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/13 "2021-07-26T05:52:58Z")

</div>

The current upload component is simply not designed for large uploads (only uploading backups in the admin UI is)

We are normalizing and refactoring our upload code at the moment and plan to support direct uploads to s3, once that is done, technically large uploads to s3 could work.

---

<div class="post-metadata">

### Author: ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)
#### Post date: [26 ביולי,‏ 2021,‏ 12:41pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/14 "2021-07-26T12:41:50Z")

</div>

Thank you for that info, @sam. I was not familiar previously with how file uploads were stored. So it seems that, by default, file uploads are stored on the same server that is running discourse–in which case I understand how large uploads might be an issue. And I get how you are working to support direct uploads to S3 in the future.

What if you configure things now to send file uploads to S3, like described [here](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229)?

Would that provide the same advantage now as what you are planning to release in the future as an automatic feature, and allow discourse to support large file uploads (and downloads)?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 באוגוסט,‏ 2021,‏ 1:43am UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/15 "2021-08-18T01:43:00Z")

</div>

> [@JQ331](#):
>
> What if you configure things now to send file uploads to S3

Our current system of uploads does `user` → `discourse server` → `s3`.

The new system we are rolling out in a few weeks does `user` → `s3`.

---

<div class="post-metadata">

### Author: ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)
#### Post date: [19 באוגוסט,‏ 2021,‏ 3:14pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/16 "2021-08-19T15:14:20Z")

</div>

Will sites be able to smoothly transition to the new upload system–so that uploads under the old system will still work and then those under the new system will also work too?

I assume so, given that all will be stored on S3, but wanted to confirm. Thanks.

---

<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: [19 באוגוסט,‏ 2021,‏ 3:18pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/17 "2021-08-19T15:18:28Z")

</div>

Since the files will end up on the same place, just taking less detours, the change will be transparent to both users and admins.

---

<div class="post-metadata">

### Author: ![JQ331](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@JQ331](https://meta.discourse.org/u/JQ331)
#### Post date: [19 באוגוסט,‏ 2021,‏ 3:48pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/18 "2021-08-19T15:48:23Z")

</div>

> [@Falco](#):
>
> the change will be transparent

To clarify: I expect users will not notice any change at all–just that (maybe?) their files will upload and download faster, and this will enable larger file uploads if the admins want. Is that about right?

---

<div class="post-metadata">

### Author: ![lucasbasquerotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucasbasquerotto/32/133376_2.png) [@lucasbasquerotto](https://meta.discourse.org/u/lucasbasquerotto)
#### Post date: [19 באוגוסט,‏ 2021,‏ 6:48pm UTC](https://meta.discourse.org/t/can-i-increase-the-1024000-kb-limit-on-attachment/165367/19 "2021-08-19T18:48:57Z")

</div>

> [@JQ331](#):
>
> that (maybe?) their files will upload and download faster

They will probably be uploaded faster. The downloads should remain the same (as the feature will affect only uploads).

> [@JQ331](#):
>
> this will enable larger file uploads if the admins want

I assume so, but it’s up to the discourse team to make an official statement about it.
