Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed headers passing in Multipart upload

  • Loading branch information...
commit f46250ab0a82c42ee4b957c086d328f4ffc245d9 1 parent 07ed770
@mludvig mludvig authored
Showing with 4 additions and 5 deletions.
  1. +3 −2 S3/MultiPart.py
  2. +1 −3 S3/S3.py
View
5 S3/MultiPart.py
@@ -14,11 +14,12 @@ class MultiPartUpload(object):
MAX_CHUNK_SIZE_MB = 5120 # 5GB
MAX_FILE_SIZE = 42949672960 # 5TB
- def __init__(self, s3, file, uri):
+ def __init__(self, s3, file, uri, headers_baseline = {}):
self.s3 = s3
self.file = file
self.uri = uri
self.parts = {}
+ self.headers_baseline = headers_baseline
self.upload_id = self.initiate_multipart_upload()
def initiate_multipart_upload(self):
@@ -26,7 +27,7 @@ def initiate_multipart_upload(self):
Begin a multipart upload
http://docs.amazonwebservices.com/AmazonS3/latest/API/index.html?mpUploadInitiate.html
"""
- request = self.s3.create_request("OBJECT_POST", uri = self.uri, extra = "?uploads")
+ request = self.s3.create_request("OBJECT_POST", uri = self.uri, headers = self.headers_baseline, extra = "?uploads")
response = self.s3.send_request(request)
data = response["data"]
self.upload_id = getTextFromXml(data, "UploadId")
View
4 S3/S3.py
@@ -747,10 +747,8 @@ def send_file(self, request, file, labels, throttle = 0, retries = _max_retries,
return response
def send_file_multipart(self, file, headers, uri, size):
- upload = MultiPartUpload(self, file, uri)
-
chunk_size = self.config.multipart_chunk_size_mb * 1024 * 1024
-
+ upload = MultiPartUpload(self, file, uri, headers)
upload.upload_all_parts()
response = upload.complete_multipart_upload()
response["speed"] = 0 # XXX
Please sign in to comment.
Something went wrong with that request. Please try again.