From 3a82dbfecbf2bda4bcab06eaeb57cd20c85d9558 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 9 Mar 2011 13:54:34 -0400 Subject: [PATCH] Add content type to avoid strip space middleware conflict --- apps/documents/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documents/views.py b/apps/documents/views.py index 4530dc212b..4185442777 100644 --- a/apps/documents/views.py +++ b/apps/documents/views.py @@ -528,7 +528,7 @@ def staging_file_preview(request, staging_file_id): try: filepath = StagingFile.get(staging_file_id).filepath output_file = convert(filepath, size=STAGING_FILES_PREVIEW_SIZE, extra_options=tranformation_string, cleanup_files=False) - return serve_file(request, File(file=open(output_file, 'r'))) + return serve_file(request, File(file=open(output_file, 'r')), content_type='image/jpeg') except Exception, e: return serve_file(request, File(file=open('%simages/1297211435_error.png' % settings.MEDIA_ROOT, 'r')))