Permalink
Browse files

Add Content-Type for Swift

  • Loading branch information...
1 parent e3e1990 commit a0a5fecedd79e49d0a7aa3ea84643c3e3c201972 @zaitcev committed Jul 6, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 hailcamsnap.py
View
@@ -103,9 +103,10 @@ def _upload_swift(self):
# Not calling conn.put_container() for the same reason of permissions.
key_name = self.cfg["prefix"] + '/' + "i" + tag
- # XXX set mime type? how? does it exist in CF/Swift?
+ mimetype = "image/jpeg"
+ headers = { "Content-Type": mimetype }
fp = open(self.cfg["file"], 'rb')
- conn.put_object(self.cfg["bucket"], key_name, fp)
+ conn.put_object(self.cfg["bucket"], key_name, fp, headers=headers)
fp.close()
def upload(self):

0 comments on commit a0a5fec

Please sign in to comment.