def download(self, REQUEST, RESPONSE): """ """ version = REQUEST.get('version', False) RESPONSE.setHeader('Content-Type', self.getContentType()) RESPONSE.setHeader('Content-Length', self.size) filename = self.utToUtf8(self.downloadfilename()) filename = self.utCleanupId(filename) RESPONSE.setHeader('Content-Disposition', 'attachment;filename=' + filename) RESPONSE.setHeader('Pragma', 'public') RESPONSE.setHeader('Cache-Control', 'max-age=0') if version and self.hasVersion(): return file_item.index_html(self.version, REQUEST, RESPONSE) return file_item.index_html(self, REQUEST, RESPONSE)
def view(self, REQUEST, RESPONSE): """ """ RESPONSE.setHeader('Content-Type', self.getContentType()) RESPONSE.setHeader('Content-Length', self.size) RESPONSE.setHeader('Pragma', 'public') RESPONSE.setHeader('Cache-Control', 'max-age=0') return file_item.index_html(self, REQUEST, RESPONSE)