title: Getting 403 (Forbidden) when uploading to S3 with a signed URL
body: <p>I'm trying to generate a pre-signed URL then upload a file to S3 through a browser. My server-side code looks like this, and it generates the URL:</p>
  
  <pre><code>let s3 = new aws.S3({
    // for dev purposes
    accessKeyId: 'MY-ACCESS-KEY-ID',
    secretAccessKey: 'MY-SECRET-ACCESS-KEY'
  });
  let params = {
    Bucket: 'reqlist-user-storage',
    Key: req.body.fileName, 
    Expires: 60,
    ContentType: req.body.fileType,
    ACL: 'public-read'
  };
  s3.getSignedUrl('putObject', params, (err, url) =&gt; {
    if (err) return console.log(err);
    res.json({ url: url });
  });
  </code></pre>
  
  <p>This part seems to work fine. I can see the URL if I log it and it's passing it to the front-end. Then on the front end, I'm trying to upload the file with axios and the signed URL:</p>
  
  <pre><code>.then(res =&gt; {
      var options = { headers: { 'Content-Type': fileType } };
      return axios.put(res.data.url, fileFromFileInput, options);
    }).then(res =&gt; {
      console.log(res);
    }).catch(err =&gt; {
      console.log(err);
    });
  }
  </code></pre>
  
  <p>With that, I get the 403 Forbidden error. If I follow the link, there's some XML with more info:</p>
  
  <pre><code>&lt;Error&gt;
  &lt;Code&gt;SignatureDoesNotMatch&lt;/Code&gt;
  &lt;Message&gt;
  The request signature we calculated does not match the signature you provided. Check your key and signing method.
  &lt;/Message&gt;
  ...etc
  </code></pre>