It is though. This is the code:
let buf = Buffer.from(
base64.replace(/^data:image\/\w+;base64,/, ""),
"base64"
);
const uploadParams = {
Bucket: "BUCKETNAME",
Body: BUFFERFILE,
Key: fileName,
ContentEncoding: "base64",
ContentType: "image/jpeg",
};
s3.upload(uploadParams, function (err, data) {
if (err) {
console.log(err);
console.log("Error uploading data: ", data);
} else {
console.log("succesfully uploaded the image!");
}
});