serve document without setting content-disposition header (#1071)

This commit is contained in:
Frédéric Péters 2011-12-01 09:41:45 +01:00
parent 29f698297a
commit 8a4e116d76
3 changed files with 14 additions and 1 deletions

View File

@ -41,4 +41,11 @@
permission="zope2.View"
/>
<browser:page
for="tabellio.documents.document.IDocument"
name="document"
class=".document.DocumentDownload"
permission="zope2.View"
/>
</configure>

View File

@ -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">

View File

@ -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