Issue #8370 has been updated by Leif Eriksen.


OK, yeah I got the wrong end of the conversation - CGI is all about the server side.....

OK an idea comes to mind

A new option in the options_hash in the constructor - currently only :tag_maker and :accept_charset are defined

The multipart handling is in the private method initialize_query(), which is only referenced in the constructor. So the only opportunity to set this up is from CGI.new.

I propose a new option in the initialize method - :max_multipart_length

It will default to the old value of 128 *1024 *1024 bytes, and can take as a value either a simple integer scalar, or a lambda. A lambda will allow the user to use more complex logic than a simple integer to determine the size of multipart forms to accept.

Would that work ?

----------------------------------------
Bug #8370: Constants MAX_MULTIPART_LENGTH in cgi\core.rb
https://bugs.ruby-lang.org/issues/8370#change-47073

* Author: Takeyuki FUJIOKA
* Status: Open
* Priority: Normal
* Assignee: Takeyuki FUJIOKA
* Category: lib
* Target version: current: 2.2.0
* ruby -v: ruby 2.1.0dev (2013-05-03 trunk 40571) [x86_64-darwin12.3.0]
* Backport: 
----------------------------------------
=begin
: Reported by Andreas Kraus via gmail.

  hi xibbar,

  I try to understand why the MAX_MULTIPART_LENGTH is a Constant and i can't change it.
  If i uload a Multipart file which is larger than 128 MB raise an error "too large multipart data.",
  but why i can't change this value to upload larger files.

  The Constant comes with this Change:
  ((<URL:https://github.com/ruby/ruby/commit/10e9b638069d9e40233242693814b86c672e423e#lib/cgi/core.rb>))

  The only sense i see, is that the Author of cgialt uses max 128MB files und build in this Constant ...

  I would like to know why this constant is in place and how to change it's behaviour.
  My requirement is to upload files larger than the given limit of 128MB.

  regards,
  Andreas
=end




-- 
https://bugs.ruby-lang.org/