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,16 +198,13 @@ class OOoDocument(PermanentURLMixIn, File, ConversionCacheMixin): ...@@ -198,16 +198,13 @@ class OOoDocument(PermanentURLMixIn, File, ConversionCacheMixin):
converted_filename = '%s.%s'%(filename.split('.')[0], format) converted_filename = '%s.%s'%(filename.split('.')[0], format)
if not mime: if not mime:
mime = getToolByName(self, 'mimetypes_registry').lookupExtension('name.%s' % format) mime = getToolByName(self, 'mimetypes_registry').lookupExtension('name.%s' % format)
if format in STANDARD_IMAGE_FORMAT_LIST: RESPONSE.setHeader('Content-Length', len(result))
RESPONSE.setHeader('Content-Type', mime) RESPONSE.setHeader('Content-Type', mime)
return result.index_html(REQUEST, RESPONSE) RESPONSE.setHeader('Accept-Ranges', 'bytes')
else: if format not in STANDARD_IMAGE_FORMAT_LIST:
RESPONSE.setHeader('Content-Length', len(result))
RESPONSE.setHeader('Content-Type', mime)
RESPONSE.setHeader('Accept-Ranges', 'bytes')
RESPONSE.setHeader('Content-Disposition', RESPONSE.setHeader('Content-Disposition',
'attachment; filename="%s"' % converted_filename) 'attachment; filename="%s"' % converted_filename)
return result return result
# Format conversion implementation # Format conversion implementation
def _getServerCoordinate(self): def _getServerCoordinate(self):
......
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