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

Posted November 22, 2020 745 views
Node.jsJavaScriptDigitalOcean Spaces

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

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