Created
December 11, 2018 16:23
-
-
Save triloknagvenkar/647b632e91a73b4ea77245b2108a4d9a to your computer and use it in GitHub Desktop.
Uploads a part in a multipart upload.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Uploads a part in a multipart upload. | |
The following code uploads part of a multipart upload. | |
it specifies a file name for the part data. The Upload ID is same that is returned by the initiate multipart upload. | |
*/ | |
continueMultiUpload(audioBlob, PartNumber, uploadId, key, bucketName) { | |
var self = this; | |
var params = { | |
Body: audioBlob, | |
Bucket: bucketName, | |
Key: key, | |
PartNumber: PartNumber, | |
UploadId: uploadId | |
}; | |
console.log(params); | |
self.s3.uploadPart(params, function(err, data) { | |
if (err) { | |
console.log(err, err.stack) | |
} // an error occurred | |
else { | |
/* | |
Once the part of data is uploaded we get an Entity tag for the uploaded object(ETag). | |
which is used later when we complete our multipart upload. | |
*/ | |
self.etag.push(data.ETag); | |
if (self.booleanStop == true) { | |
self.completeMultiUpload(); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment