[Mongrel] POST with huge HTTP body

Erik Hetzner erik.hetzner at ucop.edu
Mon Oct 15 15:13:22 EDT 2007

At Mon, 15 Oct 2007 14:00:20 +0200,
"Daniel Brahneborg" <basic70 at gmail.com> wrote:
> Hi,
> I found the following page describing how to stream data from the
> server to the client:
> http://api.rubyonrails.com/classes/ActionController/Streaming.html
> I want to do the opposite, streaming data from the client to the
> server, 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 plugin:
> http://mongrel.rubyforge.org/docs/upload_progress.html
> 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 request?
> Is it even possible?

Hi Daniel,

Mongrel is going to put a large POSTed body into a tempfile. Examine
the mongrel.rb file around line 220. In this case your request.body is
going to be a File object. Why do you think that there is a mongrel
problem here? See also what Tim Kuijsten said in this thread.

> How is the "request" parameter to the process() method related to
> the "request" object in the Rails controllers?

request in mongrel (as sent to process) is an instance of
Mongrel::HttpRequest. In Rails it is an instance of

Erik Hetzner
;; Erik Hetzner, California Digital Library
;; gnupg key id: 1024D/01DB07E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20071015/b71fcda3/attachment.bin 

More information about the Mongrel-users mailing list