Bug #530 - CloudFiles - Incorrect MIMEtypes - Fixed!
This commit is contained in:
parent
04a7b06d61
commit
13b9f054f9
@ -19,6 +19,7 @@ import shutil
|
|||||||
import urlparse
|
import urlparse
|
||||||
import uuid
|
import uuid
|
||||||
import cloudfiles
|
import cloudfiles
|
||||||
|
import mimetypes
|
||||||
|
|
||||||
from werkzeug.utils import secure_filename
|
from werkzeug.utils import secure_filename
|
||||||
|
|
||||||
@ -276,6 +277,12 @@ class CloudFilesStorage(StorageInterface):
|
|||||||
obj = self.container.create_object(
|
obj = self.container.create_object(
|
||||||
self._resolve_filepath(filepath))
|
self._resolve_filepath(filepath))
|
||||||
|
|
||||||
|
mimetype = mimetypes.guess_type(
|
||||||
|
filepath[-1])
|
||||||
|
|
||||||
|
if mimetype:
|
||||||
|
obj.content_type = mimetype[0]
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
def delete_file(self, filepath):
|
def delete_file(self, filepath):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user