On Sun, Jan 9, 2011 at 01:35, Jobe Bittman <j...@opencandy.com> wrote:
> Were you able to see where to fix that?

Hi Jobe,

Here's the patch output of what I changed and tested.  It's inline
here so that can be verified first, rather than having a file that ppl
immediate download and apply.  ;-)

-Jim P.

$ diff -r -u S3.py.orig S3.py
--- S3.py.orig  2011-01-09 17:02:16.000000000 -0500
+++ S3.py       2011-01-09 17:40:26.000000000 -0500
@@ -305,8 +305,15 @@
                        headers["x-amz-acl"] = "public-read"
                if self.config.reduced_redundancy:
                        headers["x-amz-storage-class"] = "REDUCED_REDUNDANCY"
-               # if extra_headers:
-               #       headers.update(extra_headers)
+               if extra_headers:
+                       headers.update(extra_headers)
+               content_type = None
+               if self.config.guess_mime_type:
+                       content_type = mimetypes.guess_type(src_uri.object())[0]
+               if not content_type:
+                       content_type = self.config.default_mime_type
+               debug("Content-Type set to '%s'" % content_type)
+               headers["content-type"] = content_type
                request = self.create_request("OBJECT_PUT", uri = dst_uri, 
headers = headers)
                response = self.send_request(request)
                return response
@@ -325,6 +332,13 @@
                        headers["x-amz-storage-class"] = "REDUCED_REDUNDANCY"
                if extra_headers:
                        headers.update(extra_headers)
+               content_type = None
+               if self.config.guess_mime_type:
+                       content_type = mimetypes.guess_type(src_uri.object())[0]
+               if not content_type:
+                       content_type = self.config.default_mime_type
+               debug("Content-Type set to '%s'" % content_type)
+               headers["content-type"] = content_type
                request = self.create_request("OBJECT_PUT", uri = dst_uri, 
headers = headers)
                response = self.send_request(request)
                return response


-Jim P.

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
S3tools-general mailing list
S3tools-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/s3tools-general

Reply via email to