Changeset 12446 for main/waeup.ikoba/trunk/src/waeup/ikoba/browser
- Timestamp:
- 12 Jan 2015, 09:18:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/browser/fileviewlets.py
r12444 r12446 106 106 grok.viewletmanager(FileManager) 107 107 template = default_filedisplay_template 108 grok.order(1)109 108 label = _(u'File') 110 109 title = _(u'Scan') 111 download_name = None112 113 @property114 def download_filename(self):115 return u"%s.pdf" % self.context.document_id[:9]116 110 117 111 @property … … 135 129 upload_button =_('Upload selected file') 136 130 delete_button = _('Delete') 137 138 @property139 def download_filename(self):140 return u"%s.pdf" % self.context.document_id[:9]141 131 142 132 @property … … 183 173 """ 184 174 grok.baseclass() 185 download_name = None186 187 @property188 def download_filename(self):189 return u"%s.pdf" % self.context.document_id[:9]190 175 191 176 def render(self): … … 205 190 elif ext == '.png': 206 191 self.response.setHeader('Content-Type', 'image/png') 192 elif ext == '.tif': 193 self.response.setHeader('Content-Type', 'image/tiff') 207 194 elif ext == '.pdf': 208 195 self.response.setHeader('Content-Type', 'application/pdf') 209 elif ext == '.tif':210 self.response.setHeader('Content-Type', 'image/tiff')211 if self.download_filename:212 196 self.response.setHeader('Content-Disposition', 213 'attachment; filename="%s ' % self.download_filename)197 'attachment; filename="%s.pdf' % self.download_filename) 214 198 return image
Note: See TracChangeset for help on using the changeset viewer.