1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
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
respondido hace 4 años
Contenido relevante
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 8 meses