I deployed my React project to AWS-Amplify using the following commands.
amplify init
amplify add auth api storage
And I'm facing an error while uploading images using the "aws-amplify" node module.
My code :
import { Storage } from "aws-amplify"
...
try {
Storage.put(file.name, file, {
contentType: file.type,
}).then((res) => {
console.log(res, "Upload result")
})
} catch (error) {
console.error("Error uploading file: ", error)
}
Error status :
As you can see, now Storage.put() function returns the 400 error code.
Is there anyone with the solution for this?
