I get 403 when I try to upload a file from browser using presigned url generated using aws sdk for JavaScript.

This is the code for generating presigned url:

 const params = {
    Bucket: "bucket-name", 
    Key: "atya.png", 
    Expires: 6000,
    ContentType: fileType,
    ACL: "public-read"

s3.getSignedUrl("putObject", params, function(err, url) {

The code to upload from vue app:

const res = await axios.put(signedURL, file, {
  headers: {
              "Content-type": "image/png",
              "x-amz-acl": "public-read",

I have enabled cors and given * as you can see in the image:

In the network tab I still see a 403 forbidden:

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I have the same issue and I narrowed it down to the MD5 hash I was using for the upload.

When I tried the request in Postman with the Content-MD5 headers it returned a 403 with There were headers present in the request which were not signed error