[Zope] download a file in a specific folder in the
filesystem
Gabriel Genellina
gagsl-zope at yahoo.com.ar
Thu Aug 24 13:16:34 EDT 2006
At Thursday 24/8/2006 13:55, Alan wrote:
>Thanks a lot guys, it's working fine.
>
>elif (func == 'Download'):
> fname = os.path.join(jobdir,'results.zip')
> file = open(fname,'rb').read()
> self.REQUEST.RESPONSE.setHeader('Content-Type', 'application/zip')
> return file
Better use 'application/x-zip-compressed' and perhaps:
REQUEST.RESPONSE.setHeader('Content-Disposition', 'attachment;
filename="suggested-filename.zip"')
Gabriel Genellina
Softlab SRL
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas
More information about the Zope
mailing list