title: AWS S3 File Upload causes `403 Forbidden` response: AccessDenied
body: <p>This is my code</p>
  
  <pre><code>&lt;?php
  use Aws\S3\S3Client;
  use Aws\S3\Exception\S3Exception;
  
  error_reporting(0);
  
  function pre($arr){
      echo '&lt;pre&gt;';print_r($arr);echo '&lt;/pre&gt;';
  }
  
  if($_FILES['image']['name'] != ''){
  
  require 'aws/aws-autoloader.php';
  
  $client = S3Client::factory([
      'version' =&gt; 'latest',
      'region'  =&gt; 'eu-west-2',
      'credentials' =&gt; [
          'key'    =&gt; "XXXXXXX",
          'secret' =&gt; "XXXXXXX"
      ],
      'scheme' =&gt; 'http'
   ]);
  try {
      $insert = $client-&gt;putObject([
          'Bucket'     =&gt;'xxx',
          'Key'        =&gt; $_FILES["image"]["name"],
          'SourceFile' =&gt; $_FILES["image"]["tmp_name"],
          'ACL'        =&gt; 'public-read'
      ]);
  } catch (S3Exception $e) {
      // Catch an S3 specific exception.
      echo $e-&gt;getMessage();
  }
  die;
  }
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;form action="aws.php" method="post" enctype="multipart/form-data"&gt;
      Select image to upload:
      &lt;input type="file" name="image" id="image"&gt;
      &lt;input type="submit" value="Upload Image" name="submit"&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I try to upload an image, I get this error</p>
  
  <blockquote>
    <p>Error executing "PutObject" on "<a href="http://xxx.s3.eu-west-2.amazonaws.com/b_browse.png" rel="nofollow noreferrer">http://xxx.s3.eu-west-2.amazonaws.com/b_browse.png</a>"; AWS HTTP error: Client error: <code>PUT http://xxx.s3.eu-west-2.amazonaws.com/b_browse.png</code> resulted in a <code>403 Forbidden</code> response: AccessDeniedAccess Denied07E90B (truncated...) AccessDenied (client): Access Denied - AccessDeniedAccess Denied07E90B12D3A0DBA15kSo11cfv57kBQ3sBo9dHHtZb4Xt566KS64btFHyKg6a0cIxRQWiprSAK3Tu4I+XCIyBNU3Dics=</p>
  </blockquote>
  
  <p>Any ideas on what might be the issue? I have given FullS3Permission to the user as well.</p>