Browse code

Fixed errors to make it work, finally!

Michal Ludvig authored on 2012/01/02 21:47:58
Showing 2 changed files
... ...
@@ -109,7 +109,7 @@ class MultiPartUpload(object):
109 109
         # TODO implement Content-MD5
110 110
         content_length = str(len(data))
111 111
         debug("Uploading part %i of %r (%s bytes)" % (id, self.upload_id, content_length))
112
-        headers = { "Content-Length": content_length }
112
+        headers = { "content-length": content_length }
113 113
         query_string = "?partNumber=%i&uploadId=%s" % (id, self.upload_id)
114 114
         request = self.s3.create_request("OBJECT_PUT", uri = self.uri, headers = headers, extra = query_string)
115 115
         response = self.s3.send_request(request, body = data)
... ...
@@ -127,7 +127,7 @@ class MultiPartUpload(object):
127 127
             parts_xml.append(part_xml % (id, etag))
128 128
         body = "<CompleteMultipartUpload>%s</CompleteMultipartUpload>" % ("".join(parts_xml))
129 129
 
130
-        headers = { "Content-Length": len(body) }
130
+        headers = { "content-length": len(body) }
131 131
         request = self.s3.create_request("OBJECT_POST", uri = self.uri, headers = headers, extra = "?uploadId=%s" % (self.upload_id))
132 132
         response = self.s3.send_request(request, body = body)
133 133
 
... ...
@@ -753,7 +753,7 @@ class S3(object):
753 753
 
754 754
         file.seek(0)
755 755
         upload.upload_all_parts(num_threads, chunk_size)
756
-        response = upload.complete_multipart_upload(num_threads, chunk_size)
756
+        response = upload.complete_multipart_upload()
757 757
         response["speed"] = 0 # XXX
758 758
         return response
759 759