Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] upr - Upload Progress for Rack (initial release)

Thread Tools

[ANN] upr - Upload Progress for Rack (initial release)

Eric Wong
Posts: n/a
upr is Rack middleware that allows browser-side upload progress
monitoring. It is based-on the "mongrel_upload_progress" module, but
allows any Moneta backing store in addition to DRb. There is also a
packaged example for using an ActiveRecord model for Rails.

* Removed)
* git://

You can see upr it in action at
It will report the size and SHA1 of the file you've uploaded.
Much of the demo was stolen from mongrel_upload_progress.

== Web Server Compatibility

While upr is completely Rack::Lint-compatible, upr is only compatible
with Rack web servers that support a streaming "rack.input". Currently
this is limited to {Rainbows!}[] with a
handful of concurrency models:

* ThreadSpawn
* ThreadPool
* Revactor*

For use with Revactor, the use of network-based Moneta stores or DRb is
only advised if those stores are using Revactor-aware sockets.

== JavaScript/HTML Compatibility

The current developer does not react well with GUIs. Thus all (R)HTML
and Prototype JavaScript code was stolen from mongrel_upload_progress.

Contributions to add compatibility for more modern things like JQuery
and HTML5 are very welcome.

== Backend Compatibility

We depend on {Moneta}[], which allows the
use of a multitude of key-value stores. We also provide a
DRb+Moneta::Memory server to ease transitions from

Additionally, there is an example for using Rails ActiveRecord as a
backend storage mechanism. Cookie-based upload tracking may eventually
be used, too (contributions very welcome).

== Proxy Compatibility

No proxy is required when used with Rainbows!

The only incompatible HTTP proxy we know of is nginx. nginx will buffer
large requests to the filesystem before sending them to the backend.
nginx has its own 3rd-party module for
{upload progress}[]
and may be used instead of upr.

Most other HTTP-aware and all TCP-only proxies should be compatible.
Disabling Nagle's algorithm in both the Rack web server and proxy is
advised for lower latency, especially with stunnel.

== Unicorn Compatibility

While {Unicorn}[] provides the streaming
"rack.input" for Rainbows!, using Unicorn with upr is generally NOT
recommended. Unicorn only supports fast clients and progress reporting
is unnecessary unless clients are uploading files that are hundreds of
megabyte in size or larger.

== Getting Started

gem install upr

For Rails, look at the Rails application
and RDoc. More documentation is on the way.

Eric Wong

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] upr 0.2.0 - Upload Progress for Rack Eric Wong Ruby 0 11-14-2009 02:05 AM
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM
Show Upload Progress Jeff S ASP .Net 3 04-06-2004 04:53 AM
File Upload Progress Kenneth Keeley ASP .Net 2 10-21-2003 10:46 PM
*Impossible* to build an upload progress meter using ASP.NET. Can you prove me wrong? Brian Birtle ASP .Net 3 10-16-2003 03:53 PM