[Zope] I want to stream data through an external method.

Jay, Dylan djay@lucent.com
Tue, 27 Apr 1999 18:37:26 +1000


What I have is several large files for downloading that I don't want to put
inside BoboPOS as importing them seems to take forever. It is also more
convienient if they exist outside the OODB. So what I want to do is for the
user to dl the file through Zope. I have the following external method that
works 

def serveFile(self, file, RESPONSE):
   RESPONSE.setHeader('Content-type', 'application/x-msdownload')
   dl_name = "C:/Provision/downloads/"+file
   dl_file = open(dl_name,'rb')
   retval =  dl_file.read()
   dl_file.close()
   return retval

However I think this is quite inefficient and will probably not work when
large number of users attempt to download the same file at the same time.
Anyone have a better solution?