Commits

Gerardo Curiel  committed 10a96d4

Set Content-Type header for use in upload_part_from_file

  • Participants
  • Parent commits 1574890

Comments (0)

Files changed (1)

File storages/backends/s3boto.py

         content_type = getattr(content, 'content_type',
             mimetypes.guess_type(name)[0] or Key.DefaultContentType)
 
+        # setting the content_type in the key object is not enough.
+        self.headers.update({'Content-Type': content_type})
+
         if self.gzip and content_type in self.gzip_content_types:
             content = self._compress_content(content)
             headers.update({'Content-Encoding': 'gzip'})
         if self.preload_metadata:
             self._entries[encoded_name] = key
 
+
         key.set_metadata('Content-Type', content_type)
         key.set_contents_from_file(content, headers=headers, policy=self.acl,
                                  reduced_redundancy=self.reduced_redundancy)