If you use the new amplify api from AWS, it is a lot cleaner and they handle the configuration for you.
https://aws-amplify.github.io/amplify-js/media/storage_guide.html
async saveFile(_event) {
console.log(_event);
const files = _event.detail.target.files;
const key = `${new Date().getTime()}:${files[0].name}`;
Storage.put(key, files[0], {
contentType: files[0].type,
level: "private"
})
.then(result => console.log(result))
.catch(err => console.log(err));
}
My AWS Amplify project is here.