projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
04a7b06
)
Bug #530 - CloudFiles - Incorrect MIMEtypes - Fixed!
author
Joar Wandborg
<git@wandborg.com>
Tue, 30 Aug 2011 21:56:39 +0000
(23:56 +0200)
committer
Joar Wandborg
<git@wandborg.com>
Tue, 30 Aug 2011 21:56:39 +0000
(23:56 +0200)
mediagoblin/storage.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/storage.py
b/mediagoblin/storage.py
index 7ada95e1165c3d177a37993066f715bdb4449ff9..aaddce2f789911b8aa6536fbcbf0045d7d247974 100644
(file)
--- 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):