예제 #1
0
파일: NyFile.py 프로젝트: eaudeweb/naaya
 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)
예제 #2
0
파일: NyFile.py 프로젝트: eaudeweb/naaya
 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)