[Zope] how to download big files using zope?
Yuppie
schubbe@web.de
Sun, 06 Oct 2002 07:31:41 +0200
Hi!
I have some big files (about 500 MB) in the filesystem on the server and
want to make them downloadable.
I could do something like this, but it loads the file into memory:
<code>
def manage_download(self, REQUEST):
myfile = open('myfile.bin', 'rb')
filestring = myfile.read()
myfile.close()
REQUEST.RESPONSE.setHeader('Content-type', 'application/data')
REQUEST.RESPONSE.setHeader('Content-Disposition',
'inline;filename=myfile.bin')
return filestring
</code>
Is there a way to just pass the file through? Without loading it in a
string or in the ZODB?
Any hints are welcome.
TIA,
Yuppie