--- versionedFile/versionedFile.py 2005/10/17 16:06:27 1.44 +++ versionedFile/versionedFile.py 2005/10/19 11:56:52 1.48 @@ -515,17 +515,21 @@ class versionedFileObject(File): - def download(self): + def download(self,REQUEST=None,RESPONSE=None): """download and lock""" self.REQUEST.RESPONSE.setHeader("Content-Disposition","""attachement; filename=%s"""%self.getId()) - self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream") + self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream") self.content_type="application/octet-stream" #self.REQUEST.RESPONSE.redirect(self.absolute_url()) - txt=urllib.urlopen(self.absolute_url()).read() - self.REQUEST.RESPONSE.write(txt) - #self.REQUEST.RESPONSE.write("bl") + #txt=urllib.urlopen(self.absolute_url()).read() + #self.REQUEST.RESPONSE.write(txt) + try: + self.REQUEST.RESPONSE.write(self.index_html()) + except: + self.REQUEST.RESPONSE.write(self.index_html(REQUEST,RESPONSE)) + self.REQUEST.close() def downloadLocked(self): @@ -829,7 +833,7 @@ class versionedFile(Folder): """download and lock""" self.REQUEST.RESPONSE.setHeader("Content-Disposition","""attachement; filename=%s"""%self.getLastVersion().getId()) - self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream") + self.REQUEST.RESPONSE.setHeader("Content-Type","application/octet-stream") self.content_type="application/octet-stream" #self.REQUEST.RESPONSE.write("bl")