In lib/ruby/2.4.0/cgi/core.rb in line 646 there is this:
@@max_multipart_length= 128 * 1024 * 1024
And this seems to be the limit of my file upload to server side. I can
upload a 120 MB file, but cannot upload of a 130 MB size. I’ve got an
error:
/usr/local/lib/ruby/2.4.0/cgi/core.rb:646:in initialize_query': too large multipart data. (StandardError) from /usr/local/lib/ruby/2.4.0/cgi/core.rb:852:ininitialize’
My environment is:
OS: Ubuntu Linux 16.04 LTS (64 bit)
Ruby: 2.4.1p111
Web server: Apache 2.4.18-2
I have no other security stuff (modsecurity, evasive etc), but plain
Apache.
Note that this approach is not without risk and we can smell the hack.
For instance, if the module has another variable which depends on the
one you are going to change, i.e. something like
@@my_funny_valentine = @@max_multipart_lenght * 2
this connection is broken, as the other variable, naturally, is not
being updated accordingly.
Another (safer) possibility would be to make your own, local,
installation of Ruby, and update the value there inside core.rb. This
again has the drawback that this has to be done on every installation of
a new Ruby method.
So, no solution is really nice, but I can’t offer anything better.