[Mongrel] POST with huge HTTP body

Tim Kuijsten kuijsten at yahoo.com
Mon Oct 15 09:33:18 EDT 2007

A while ago I wrote a plugin to limit uploads in Mongrel. Mongrel does save uploads to a tempfile on disk - if the upload is bigger than about 12 KB - using a Ruby TempFile-object. (which stores in the $TMPDIR, /tmp on most systems).

The request is handed over to Rails after it's fully received by Mongrel.

I'm not sure if this "saving to disk" works the same with chunked uploads (uploads without a Content-Length header).

Maybe my plugin can help you: http://slasaus.netsend.nl/articles/show/7 (warning: it works, but is not very elegant).



----- Original Message ----
From: Daniel Brahneborg <basic70 at gmail.com>
To: mongrel-users at rubyforge.org
Sent: Monday, October 15, 2007 2:00:20 PM
Subject: [Mongrel] POST with huge HTTP body


I found the following page describing how to stream data from the
server to the client:


I want to do the opposite, streaming data from the client to the
letting the controller saving the data while it's being received.
In particular, I want to upload large files to the RailsDav
(http://www.liverail.net/railsdav) plugin, without having to store
the entire file in memory during the operation.

This seems to be a Mongrel problem, so I started looking at this


How do I get Mongrel to store the incoming POST  data in a tempfile,
passing a handler to that file as the raw_post field in the Rails
Is it even possible?
How is the "request" parameter to the process() method related to the
"request" object in the Rails controllers?

Mongrel-users mailing list
Mongrel-users at rubyforge.org

Shape Yahoo! in your own image.  Join our Network Research Panel today!   http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

More information about the Mongrel-users mailing list