1 個回答
- 最新
- 最多得票
- 最多評論
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
已回答 4 年前
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前