[mod_python] Serving FS data

Nicolas Lehuen nicolas.lehuen at gmail.com
Tue Jan 18 10:46:57 EST 2005

Use req.sendfile(). See :


Maybe we should add this to the FAQ (http://www.modpython.org/FAQ/faqw.py) ?



On Tue, 18 Jan 2005 16:21:04 +0100, Igor Stroh <igor at rulim.de> wrote:
> Hi there,
> I'm looking for a way to serve files from the filesystem
> through mod_python. Right now I'm just doing stuff like
> request.write(file(<path>).read())
> but this is obviously quite expensive when the files are
> big, since they're dumped at once into memory...
> The whole thing would be ways faster if there would be
> a way to just "pipe" those files through mod_python
> directly to apache, i.e. just by pointing to a path
> or a file descriptor... Any ideas?
> TIA,
> Igor
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list