Permalink
Browse files

Fixed errors to make it work, finally!

  • Loading branch information...
1 parent 880e0de commit 7b09ee878e305de189912d02998bef704177e573 @mludvig mludvig committed Jan 2, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 S3/MultiPart.py
  2. +1 −1 S3/S3.py
View
@@ -109,7 +109,7 @@ def upload_part(self, data, id):
# TODO implement Content-MD5
content_length = str(len(data))
debug("Uploading part %i of %r (%s bytes)" % (id, self.upload_id, content_length))
- headers = { "Content-Length": content_length }
+ headers = { "content-length": content_length }
query_string = "?partNumber=%i&uploadId=%s" % (id, self.upload_id)
request = self.s3.create_request("OBJECT_PUT", uri = self.uri, headers = headers, extra = query_string)
response = self.s3.send_request(request, body = data)
@@ -127,7 +127,7 @@ def complete_multipart_upload(self):
parts_xml.append(part_xml % (id, etag))
body = "<CompleteMultipartUpload>%s</CompleteMultipartUpload>" % ("".join(parts_xml))
- headers = { "Content-Length": len(body) }
+ headers = { "content-length": len(body) }
request = self.s3.create_request("OBJECT_POST", uri = self.uri, headers = headers, extra = "?uploadId=%s" % (self.upload_id))
response = self.s3.send_request(request, body = body)
View
@@ -753,7 +753,7 @@ def send_file_multipart(self, file, headers, uri, size):
file.seek(0)
upload.upload_all_parts(num_threads, chunk_size)
- response = upload.complete_multipart_upload(num_threads, chunk_size)
+ response = upload.complete_multipart_upload()
response["speed"] = 0 # XXX
return response

0 comments on commit 7b09ee8

Please sign in to comment.