def download_attachment(self, visiting_group_id, doc_id): response.content_type='x-application/download' response.headerlist.append(('Content-Disposition','attachment;filename=%s' % doc_id)) return holly_couch.get_attachment(visiting_group_id, doc_id).read()
def download_attachment(self, attachment_id, doc_id): response.content_type='x-application/download' log.debug(u'Trying to download attachment="%s" filename="%s"' % (attachment_id, doc_id)) headers = ('Content-Disposition', ('attachment;filename=%s' % doc_id).replace(u' ',u'_').replace(u'å',u'a').replace(u'ö',u'o').encode('ascii', 'replace')) response.headerlist.append(headers) return holly_couch.get_attachment(attachment_id, doc_id).read()