I'm still trying to stream a file in an HTTP response in Pylons . In addition to the original problem, I found that I cannot return the Content-Length header, so for large files the client cannot estimate how long the download will take. I tried
response.content_length = 12345
and i tried
response.headers['Content-Length'] = 12345
In both cases, the HTTP response (viewed in Fiddler) simply does not contain the Content-Length header. How to get Pylons to return this header?
(Oh, and if you have any ideas on how it will transfer the file, answer the original question - I have all the ideas here.)
Edit: While not a general solution, FileApp allows you to send a Content-Length header to serve static files. For dynamic content, it looks like Alex Martelli's Answer is the only option.
EMP
source share