Commit 78b27c49 authored by Bastian Kuhn's avatar Bastian Kuhn

Set correct Fileheaders when Uploading to S3

This change add's the content Type Header to the save_file function
before uploading to s3. This is needed for example when uploading svg files.
parent 7165a0a4
......@@ -134,7 +134,10 @@ class S3Storage(object):
def save_file(self, path, file_data):
key = Key(self.bucket, path)
key.set_contents_from_file(file_data.stream)
headers = {
'Content-Type' : file_data.content_type,
}
key.set_contents_from_file(file_data.stream, headers=headers)
def delete_tree(self, directory):
self._check_empty_directory(directory)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment