Don’t set it in the Metadata section, that’s only for properties that will be prefixed with x-amz-meta. There is a ContentType parameter at the main level, like so:
var s3 = new AWS.S3();
var params = {
Body: buffer,
Bucket: <bucket>,
Key: <key>,
ContentType: 'image/jpeg'
};
s3.putObject(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else {
console.log(data);
}
})





![Cannot read property ‘toLowerCase’ of undefined [ERROR] An error occurred while running subprocess cordova.](https://blog.rahulbhutani.com/wp-content/uploads/2020/12/ionic-enable-xcode-permissions-banner-100x70.png)












