I have a function that takes a stream as a parameter:
startUpload(stream, filename) {
const upload = this.s3.upload({
Bucket: this.bucket,
ServerSideEncryption: 'aws:kms',
SSEKMSKeyId: this.s3SseKmsKeyId,
Key: `${this.key}/${filename}`,
Body: stream
}, { partSize: 50 * 1024 * 1024, queueSize: 1 });
}
How do I create a stream and write data to it?