--- versionedFile/versionedFile.py 2005/10/05 11:21:56 1.43 +++ versionedFile/versionedFile.py 2005/10/19 11:56:52 1.48 @@ -17,7 +17,7 @@ from threading import Thread import shutil import tempfile import os.path - +import urllib import time try: @@ -515,16 +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()) - self.REQUEST.RESPONSE.write(self.index_html()) - #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): @@ -828,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")