Commit d2088e97 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix a mistake in r29137.

(display converted result in the browser if requested format is standard image format.)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29178 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c7c3b3dc
......@@ -198,13 +198,10 @@ class OOoDocument(PermanentURLMixIn, File, ConversionCacheMixin):
converted_filename = '%s.%s'%(filename.split('.')[0], format)
if not mime:
mime = getToolByName(self, 'mimetypes_registry').lookupExtension('name.%s' % format)
if format in STANDARD_IMAGE_FORMAT_LIST:
RESPONSE.setHeader('Content-Type', mime)
return result.index_html(REQUEST, RESPONSE)
else:
RESPONSE.setHeader('Content-Length', len(result))
RESPONSE.setHeader('Content-Type', mime)
RESPONSE.setHeader('Accept-Ranges', 'bytes')
if format not in STANDARD_IMAGE_FORMAT_LIST:
RESPONSE.setHeader('Content-Disposition',
'attachment; filename="%s"' % converted_filename)
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment