Can I increase the 1024000 kb limit on attachment?

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

1 Like

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.

3 Likes

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

1 Like

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

6 Likes

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?
1 Like

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.

5 Likes

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

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.

3 Likes

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

1 Like

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.

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.

1 Like

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?

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.

5 Likes

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?

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)?

Our current system of uploads does userdiscourse servers3.

The new system we are rolling out in a few weeks does users3.

5 Likes

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.

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

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?

1 Like

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

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

1 Like