title: AWS S3 browser upload getting Access Denied error
body: <p>I'm trying to upload files to an S3 bucket directly from a browser using POST AWS signature version 4. Initially, I was getting signature validation errors, which I managed to resolve but now I'm getting this error:</p>
  
  <pre><code>&lt;Error&gt;
    &lt;Code&gt;AccessDenied&lt;/Code&gt;
    &lt;Message&gt;Access Denied&lt;/Message&gt;
    &lt;RequestId&gt;9343E20EAA0FD14E&lt;/RequestId
    &lt;HostId&gt;RldZp4h5n6tK8R5WKmWnn0k8PNvJGxb6m...&lt;/HostId&gt;
  &lt;/Error&gt;
  </code></pre>
  
  <p>I enabled logging in my S3 bucket but they are minimal and don't provide anything additional insight.</p>
  
  <p>I have the following bucket policy:</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "AddPerm",
              "Effect": "Allow",
              "Principal": {
                  "AWS": "arn:aws:iam::000000000000:user/username"
              },
              "Action": [
                  "s3:GetObject",
                  "s3:PutObject"
              ],
              "Resource": "arn:aws:s3:::bucketname/*"
          }
      ]
  }
  </code></pre>
  
  <p>When I use API key/secret of my user to upload files from my computer or EC2 instance, it works but using the browser upload with signed policy, gives me the above error.</p>