Rails 4.2: Internal Server Error with Maximum file multiparts in content reached

It looks like the multipart limit was added in the Rails 4.2 version of Rack (https://github.com/rack/rack/commit/b0b5fb9467e6ed777d3eaf35afc81d758e308aab). The default is 128, which may be too little for your purposes, it was for mine. Setting the value to 0 in an initializer removes the limit and fixes the problem:

Rack::Utils.multipart_part_limit = 0

I would suggest tailoring the value until it fits your needs so your server doesn’t run out of file handles. My app uses a massive form and setting it to 512 seemed to work for me.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)