Content-Length header not returned from Pylons response

Posted by Evgeny on Stack Overflow See other posts from Stack Overflow or by Evgeny
Published on 2010-05-06T01:30:31Z Indexed on 2010/05/06 1:38 UTC
Read the original article Hit count: 294

Filed under:
|
|
|

I'm still struggling to Stream a file to the HTTP response in Pylons. In addition to the original problem, I'm finding that I cannot return the Content-Length header, so that for large files the client cannot estimate how long the download will take. I've tried

response.content_length = 12345

and I've tried

response.headers['Content-Length'] = 12345

In both cases the HTTP response (viewed in Fiddler) simply does not contain the Content-Length header. How do I get Pylons to return this header?

(Oh, and if you have any ideas on making it stream the file please reply to the original question - I'm all out of ideas there.)

© Stack Overflow or respective owner

Related posts about python

Related posts about pylons