> I've found several messages on this list discussing ways to send large
> files in a HttpResponse.  One can use FileWrapper, or one can use a
> generator and yield chunks of the large file.  What about the case
> when the large file is generated at HTTP request time?  In this case,
> it would be annoying to have the user wait for the page to generate
> the large file and then stream the file.  Instead we would want a way
> to start the HTTP response (so that the user gets the download
> dialogue), generate the large file, and then stream the file.
>
> [..snip..]
>
> The issue with the above example is that the "yield ''" seems to be
> ignored.  HTTP headers are not sent before the tarball is created.


Out of curiosity, what deployment method are you using?

Looking at the code for the wsgi handler, it does call start_response()
before processing any of the response body - my understanding is that
this should cause the headers to be sent immediately.  Have you tried
this under mod_wsgi?

 Cheers,

   Ryan


-- 
Ryan Kelly
http://www.rfk.id.au  |  This message is digitally signed. Please visit
r...@rfk.id.au        |  http://www.rfk.id.au/ramblings/gpg/ for details

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to