[Web-SIG] serving (potentially large) files through wsgi?

Ian Bicking ianb at colorstudy.com
Fri Dec 14 18:18:36 CET 2007

Chris Withers wrote:
> Hi All,
> What's the best way to serve large files (say detailed images or pdfs) 
> from a wsgi app?
> Is there special support for this?
> Also, does wsgi offer anything to help with http range requests and the 
> like?

It's not part of any WSGI standard, but in WebOb if there is a range 
request, a 200 response (i.e., no range has been applied) and app_iter 
has an app_iter_range method, it will use that to send a range response. 
  This response rewriting isn't on by default in WebOb, but I've usually 
turned it on in my own code.

An example is at the bottom of this tutorial: 

Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org

More information about the Web-SIG mailing list