web/views/idownloadable.py
branchstable
changeset 8612 3bb96935a6b9
parent 8190 2a3c1b787688
child 8695 358d8bed9626
equal deleted inserted replaced
8611:51068fe1e39a 8612:3bb96935a6b9
    98             encoding = None
    98             encoding = None
    99         else:
    99         else:
   100             contenttype = adapter.download_content_type()
   100             contenttype = adapter.download_content_type()
   101         self._cw.set_content_type(contenttype or self.content_type,
   101         self._cw.set_content_type(contenttype or self.content_type,
   102                                   filename=adapter.download_file_name(),
   102                                   filename=adapter.download_file_name(),
   103                                   encoding=encoding)
   103                                   encoding=encoding,
       
   104                                   disposition='attachment')
   104 
   105 
   105     def call(self):
   106     def call(self):
   106         entity = self.cw_rset.complete_entity(self.cw_row or 0, self.cw_col or 0)
   107         entity = self.cw_rset.complete_entity(self.cw_row or 0, self.cw_col or 0)
   107         adapter = entity.cw_adapt_to('IDownloadable')
   108         adapter = entity.cw_adapt_to('IDownloadable')
   108         self.w(adapter.download_data())
   109         self.w(adapter.download_data())