From 04ee751a7bf4cb2d1596560675a84b37d39b8e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl> Date: Fri, 22 Dec 2006 14:37:15 +0000 Subject: [PATCH] Send content_type if available (patch by Luke, Poland) git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11781 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../portal_skins/erp5_core/Base_download.xml | 6 +++++- product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml index a7be2cf5b4..845433f1a9 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml @@ -69,7 +69,10 @@ <item> <key> <string>_body</string> </key> <value> <string>request=context.REQUEST\n -request.RESPONSE.setHeader(\'Content-type\', context.getFormat())\n +if hasattr(context,\'getContentType\'):\n + request.RESPONSE.setHeader(\'Content-type\', context.getContentType())\n +else:\n + request.RESPONSE.setHeader(\'Content-type\', context.getFormat())\n request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % context.title_or_id())\n return context.manage_FTPget()\n </string> </value> @@ -117,6 +120,7 @@ return context.manage_FTPget()\n <string>_getattr_</string> <string>context</string> <string>request</string> + <string>hasattr</string> </tuple> </value> </item> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index fba8ce006f..bcad85486c 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -224 \ No newline at end of file +225 \ No newline at end of file -- 2.30.9