From 13b9f054f9a548d418c95adca1b4fddcb7e3cf1e Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 30 Aug 2011 23:56:39 +0200 Subject: [PATCH] Bug #530 - CloudFiles - Incorrect MIMEtypes - Fixed! --- mediagoblin/storage.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mediagoblin/storage.py b/mediagoblin/storage.py index 7ada95e1..aaddce2f 100644 --- a/mediagoblin/storage.py +++ b/mediagoblin/storage.py @@ -19,6 +19,7 @@ import shutil import urlparse import uuid import cloudfiles +import mimetypes from werkzeug.utils import secure_filename @@ -276,6 +277,12 @@ class CloudFilesStorage(StorageInterface): obj = self.container.create_object( self._resolve_filepath(filepath)) + mimetype = mimetypes.guess_type( + filepath[-1]) + + if mimetype: + obj.content_type = mimetype[0] + return obj def delete_file(self, filepath): -- 2.25.1