From 8a4e116d7674dede5128a50d5a74f665b449f4ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 1 Dec 2011 09:41:45 +0100 Subject: [PATCH] serve document without setting content-disposition header (#1071) --- tabellio/pfbviews/configure.zcml | 7 +++++++ tabellio/pfbviews/document.pt | 2 +- tabellio/pfbviews/document.py | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tabellio/pfbviews/configure.zcml b/tabellio/pfbviews/configure.zcml index 5cb759a..2cf60e2 100644 --- a/tabellio/pfbviews/configure.zcml +++ b/tabellio/pfbviews/configure.zcml @@ -41,4 +41,11 @@ permission="zope2.View" /> + + diff --git a/tabellio/pfbviews/document.pt b/tabellio/pfbviews/document.pt index f5d99a0..d359316 100644 --- a/tabellio/pfbviews/document.pt +++ b/tabellio/pfbviews/document.pt @@ -17,7 +17,7 @@
diff --git a/tabellio/pfbviews/document.py b/tabellio/pfbviews/document.py index 6a398fd..d94f000 100644 --- a/tabellio/pfbviews/document.py +++ b/tabellio/pfbviews/document.py @@ -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