[mod_python] weird error in mod_python (3.1.4.r1) /scipy(0.4.8)/gentoo (~x86) web application

Jim Gallacher jpg at jgassociates.ca
Mon Jun 5 18:49:49 EDT 2006


Webb Sprague wrote:
> Hi all,
> 
> I am using mod_python to send binary files and I would like the client
> to know the length of the file (so their "percent downloaded" widget
> can be used).  Is there a way to put the byte length in the headers
> some how?
> 
> I did look in the request object docs, but couldn't find it.

 From the docs:


set_content_length(len)
     Sets the value of req.clength and the "Content-Length" header to 
len. Note that after the headers have been sent out (which happens just 
before the first byte of the body is written, i.e. first call to 
req.write()), calling the method is meaningless.

Jim


More information about the Mod_python mailing list