Zope 2.8.0, Python 2.3.5<br>
<br>
I'm having a heck of a time figuring out how to zip up some files in my
zope instance and return them to the user. I can sucessfully create a
zip file on the local file system, but if I try to pass it back to the
user it is corrupted. Of course I'd rather not create this tmp3.zip
file, so if there's a way around that (which I'm sure there is!) please
do let me know.<br>
<br>
filename = 'test.zip'<br>
response = self.REQUEST.RESPONSE<br>
response.setHeader('Content-Type','application/zip')<br>
<div id="mb_0">
response.setHeader('Content-Disposition','attachment; filename=%s' % filename)<br>
# tried zf =
zipfile.ZipFile( response, 'w' ) but get error, ZHTTP object doesn't
have tell method<br>
zf = zipfile.ZipFile( '/tmp3.zip', 'w' )<br>
zf.writestr( 'testfilename', str( self._getOb( testfileid ) ) )<br>
zf.close()<br>
f = open('/tmp3.zip')<br>
return f.read()<br>
<br>
Any thoughts on what fairly obvious thing I'm doing wrong? Thanks!<br><span class="sg">
John</span></div>