Arbitrarily large file uploads

(dobon) #1

Hey all.

I was recently trying to remove/increase-exponentially the image and attachment file size caps on my private discourse forum, and unknowingly bumped into the 10MB hard-coded limit. While reading through this site to figure out what was going on, I saw a thread (which I have tried to failed twice to re-locate, sorry) mentioning an initiative to allow for arbitrary file uploads by using some file upload software, such as plupload. I am curious about the state of this initiative and where I might be able to help out.

  1. What are the current limitations that make large file uploads a bad idea? Front-end limitations? Server-side limitations?
  2. What efforts have been made so far? Anything that can be built upon?
  3. Is there a group working on this? How can I get involved?

Cheers, and thanks for the world’s greatest forum software!

(Jesse Perry) #2

Other than the setting for this in Admin Settings, it’s not Discourse limiting you, it’s Nginx.

Easy fix: Discourse Meta

(dobon) #3

No, there really is a hard-coded 10MB cap:

(Jeff Atwood) #4

Well that is odd, @zogstrip can you have a look?

(Mittineague) #5

IIRC quite some time ago there was discussion about setting a “:sane” limit due to excessive file sizes causing problems.

Maybe the code involved with those potential problems has since changed, and so too what would be considered sane would be?

(dobon) #6

This sounds like exactly the discussion I had read and refer to in my OP. It is my understanding that large uploads require mondo resources on the server-side… or something like that. Hoping to get expert opinions ITT.

(Mittineague) #7

Maybe this one?

(dobon) #8

This is the discussion I was thinking of: Optimize images before uploading? (found it by searching for ‘plupload’!)

(Régis Hanol) #9

Just removed the 10MB hard limit on the client-side since it’s not usefull now that we will automatically downsize images to match the maximum value.

But, as @jesselperry said, there is another hard-coded limit in NGINX. This limit is here to prevent people from DOSing your forum by uploading lots of large files, thus exhausting your connections pool.

(dobon) #10

Awesome! Thanks @zogstrip. So will this fix be in the next minor release? (I know that I could clone the master repo where it was pushed to, I’m just curious about how releases work).

(Régis Hanol) #11

It depends on what branch you are following. If you’re following “tests-passed” (which is the default), you just need to rebuild the container to get the fix. Otherwise, you’ll have to wait for the next minor release yeah :wink: