1 Answer
- Newest
- Most votes
- Most comments
0
I resolved this problem! I sending file using base64 to API Gateway and lambda functions setup parameter "ContentEncoding: 'base64'".
...
buf = new Buffer(obj.content,'base64')
let fileName = crypto.createHash('md5').update(config.application_name+'_'+Date.now()).digest("hex");
s3 = new AWS.S3({apiVersion: config.s3.version});
var uploadParams = {
Bucket: config.s3.bucket_name,
Key: config.s3.file_path+fileName+obj.extension,
Body: buf,
ContentEncoding: 'base64',
*ContentType: obj.content_type,*
ACL: "public-read"
};
s3.upload(uploadParams, function (err, data)
...
Edited by: LeandroBR on Apr 12, 2020 11:47 AM
answered 5 years ago
Relevant content
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago