Sebastian Krollmann wrote:
Hi Peter,
Hm, I think (downloading) performance should be roughly the same -- after all, the files would still have to loaded by Zope, at least with Products like LocalFS and ExtFile that first load the whole file into memory before starting to serve it? I wrote myself a streaming method for this reason.
So either to patch LocalFS and ExtFile not to wait until complete load or reading the file by external methods like Dieter Maurer suggested.
What does your streaming method do, just downloading the file?
Its pretty simple -- I actually use LocalFS so users can browse / upload files, and this: def streamFile(file, name, REQUEST): """file is a LocalFS file object, name is the file name""" resp = REQUEST.RESPONSE path = file.path ctype = file._getType() size = file.get_size() # logging.debug("setting type: %s, path: %s" % (ctype, path)) resp.setHeader('Content-Type', ctype) resp.setHeader('Content-Length', size) resp.setHeader('Content-Location', name) read = open(path, 'rb').read write = resp.write while 1: data = read(CONST_STREAMREADSIZE) if data == '': break write(data) is for downloading. hth, peter.
Thanks for your answers,
SK
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )