[Mongrel] Mongrel upload progress not showing progress on production server

Zed A. Shaw zedshaw at zedshaw.com
Wed Feb 28 23:29:53 EST 2007

On Wed, 28 Feb 2007 19:04:25 -0300
"Benjamin Jackson" <bhjackson at gmail.com> wrote:

> Hey Zed,
> > Honestly, the idea of upload progress done this way (with polling http
> > requests) is a super bad idea in my book.  It's currently a hack to
> > work around a broken UI in the browser, so I try not to steer people in
> > this direction.
> >
> > What you should do, if you're interested, is contact Ezra at
> > ez at engineyard.com as he does custom setups of this using Merb.  If you
> > want to do it yourself, http://merb.devjavu.com/ has example code in it
> > that you can use.
> What would you suggest to someone who needs to allow clients to upload
> files of more than a meg or two if not an upload progress script? It's
> difficult to tell someone that they'll need to stare at their monitor
> for a half hour to an hour while the upload churns on with no progress
> :P

First off, an upload of 2-3 mb won't take so long that you have to
provide a second-by-second byte accurate feedback mechanism to them.  A
simple spinner graphic saying "just a moment" is most more than

If your application is such that you need absolute accuracy on
progress, resumable uploads, validation of the upload, etc. then don't
use HTTP.  It doesn't do any of this and your app will have a mountain
to climb over.

If you need to simply provide a nice way to show progress of really
large files (and again, HTTP wasn't designed for this so you're
basically fixing a browser usability issue) then you should use flash.
There's a few rather nice upload progress meters that don't use this
stupid 2-second HTTP poll mechanism and just do what the rest of the
world does:  keep track of what's been sent over the socket.

In other words, using repeated HTTP requests to ask the server what the
browser has sent in a blow-by-blow accurate way so that you can show
someone what's effectively a spinner for a few seconds or minutes is a
dumb way to use HTTP.  There's other much better tools, especially if
you need to have the upload be reliable in any way.

Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.awprofessional.com/title/0321483502 -- The Mongrel Book
http://www.lingr.com/room/3yXhqKbfPy8 -- Come get help.

More information about the Mongrel-users mailing list