Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra options break multipart upload logic #26

Open
wmagda opened this issue Jul 14, 2017 · 0 comments
Open

Extra options break multipart upload logic #26

wmagda opened this issue Jul 14, 2017 · 0 comments

Comments

@wmagda
Copy link

wmagda commented Jul 14, 2017

I'm trying to add ServerSideEncryption option:
var ws = S3S.WriteStream(core.S3Client, { ServerSideEncryption: 'AES256', Bucket: bucketName, Key: fileName });

However that results in this error at the end of upload:
Unhandled rejection UnexpectedParameter: Unexpected key 'ServerSideEncryption' found in params.MultipartUpload.Parts[0]

That's because of this code in MultipartUpload.prototype.uploadPart:
return (err) ? reject(err) : resolve(_.assign({ }, result, { PartNumber: partNumber }));

The problem here is that the extra option is returned as part of result and then you pass that option to Parts array. Parts array can only have ETag and PartNumber resulting in this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant