serve document without setting content-disposition header (#1071)
This commit is contained in:
parent
29f698297a
commit
8a4e116d76
|
@ -41,4 +41,11 @@
|
|||
permission="zope2.View"
|
||||
/>
|
||||
|
||||
<browser:page
|
||||
for="tabellio.documents.document.IDocument"
|
||||
name="document"
|
||||
class=".document.DocumentDownload"
|
||||
permission="zope2.View"
|
||||
/>
|
||||
|
||||
</configure>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<div tal:replace="structure provider:plone.abovecontentbody" />
|
||||
|
||||
<div tal:condition="context/file" class="document-download">
|
||||
<a tal:attributes="href string:${context/absolute_url}/@@download/file">Télécharger le fichier</a>
|
||||
<a tal:attributes="href string:${context/absolute_url}/document">Télécharger le fichier</a>
|
||||
</div>
|
||||
|
||||
<div tal:condition="context/doctype" class="field">
|
||||
|
|
|
@ -3,3 +3,9 @@ from Products.Five import BrowserView
|
|||
class View(BrowserView):
|
||||
pass
|
||||
|
||||
|
||||
class DocumentDownload(BrowserView):
|
||||
def __call__(self):
|
||||
self.request.response.setHeader('Content-type',
|
||||
self.context.file.contentType)
|
||||
return self.context.file.data
|
||||
|
|
Reference in New Issue