Commits

Simone Marzola committed 21ba547

set the s3_key mime-type if the uploaded file is a cgi.FieldStorage instance

Comments (0)

Files changed (1)

tgext/datahelpers/remote_attachments.py

         return self.s3_key.generate_url(config.get('s3_expire', 3600))
 
     def write(self):
+        if getattr(self.file, 'type', None):
+            self.s3_key.set_metadata('Content-Type', self.file.type)
         self.s3_key.set_contents_from_file(self.file, policy='public-read')
         self.file.seek(0)