I used connect-multiparty middlewhere and I have below code:
console.log(req.files)
var data = {
Key: req.body.filename,
Body: req.files,
ContentType: 'image/jpeg'
};
s3Bucket.putObject(data,function(err,result){
console.log(err);
});
And I got below result in my terminal:
{ photo:
{ fieldName: 'photo',
originalFilename: 'blob',
path: '/var/folders/n1/fr69rt5j01sfwjhsh3jx3gh00000gn/T/Tw4pwoPQ5D7zCGxrk3U1ywKp',
headers:
{ 'content-disposition': 'form-data; name="photo"; filename="blob"',
'content-type': 'image/jpeg' },
size: 50138,
name: 'blob',
type: 'image/jpeg' } }
{ [InvalidParameterType: Expected params.Body to be a string, Buffer, Stream, Blob, or typed array object]
message: 'Expected params.Body to be a string, Buffer, Stream, Blob, or typed array object',
code: 'InvalidParameterType',
Any clue this doesn't work? What should be Body's value?