From c43f8c1d927c7b01d70bdd5662848fa3009f1141 Mon Sep 17 00:00:00 2001 From: Joar Wandborg Date: Tue, 23 Oct 2012 01:09:09 +0200 Subject: Fixed attachments --- mediagoblin/storage/cloudfiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mediagoblin/storage/cloudfiles.py') diff --git a/mediagoblin/storage/cloudfiles.py b/mediagoblin/storage/cloudfiles.py index ced3beb3..1b5a6363 100644 --- a/mediagoblin/storage/cloudfiles.py +++ b/mediagoblin/storage/cloudfiles.py @@ -104,10 +104,13 @@ class CloudFilesStorage(StorageInterface): mimetype = mimetypes.guess_type( filepath[-1]) - if mimetype: + if mimetype[0]: # Set the mimetype on the CloudFiles object obj.content_type = mimetype[0] obj.metadata = {'mime-type': mimetype[0]} + else: + obj.content_type = 'application/octet-stream' + obj.metadata = {'mime-type': 'application/octet-stream'} return CloudFilesStorageObjectWrapper(obj, *args, **kwargs) -- cgit v1.2.3