title: Error executing "PutObject" on AWS, upload fails
body: <p>I have established an AWS acct. and am trying to do my first programmatic PUT into S3. I have used the console to create a bucket and put things there. I have also created a subdirectory (myFolder) and made it public. I created my .aws/credentials file and have tried using the sample codes but I get the following error:</p>
  
  <blockquote>
    <p>Error executing "PutObject" on "<a href="https://s3.amazonaws.com/gps-photo.org/mykey.txt" rel="noreferrer">https://s3.amazonaws.com/gps-photo.org/mykey.txt</a>"; AWS HTTP error: Client error: <code>PUT https://s3.amazonaws.com/gps-photo.org/mykey.txt</code> resulted in a <code>403 Forbidden</code> response:
        
        <Code>AccessDenied</Code>Access DeniedFC49CD (truncated...)
        AccessDenied (client): Access Denied - 
        <Code>AccessDenied</Code>Access DeniedFC49CD15567FB9CD1GTYxjzzzhcL+YyYsuYRx4UgV9wzTCQJX6N4jMWwA39PFaDkK2B9R+FZf8GVM6VvMXfLyI/4abo=</p>
  </blockquote>
  
  <p>My code is</p>
  
  <pre><code>&lt;?php
  
  // Include the AWS SDK using the Composer autoloader.
  require '/home/berman/vendor/autoload.php';
  use Aws\S3\S3Client;
  use Aws\S3\Exception\S3Exception;
  $bucket = 'gps-photo.org';
  $keyname = 'my-object-key';
  // Instantiate the client.
  $s3 = S3Client::factory(array(
      'profile' =&gt; 'default',
      'region' =&gt; 'us-east-1',
      'version' =&gt; '2006-03-01'
  ));
  try {
      // Upload data.
      $result = $s3-&gt;putObject(array(
          'Bucket' =&gt; $bucket,
          'Key'    =&gt; "myFolder/$keyname",
          'Body'   =&gt; 'Hello, world!',
          'ACL'    =&gt; 'public-read'
      ));
      // Print the URL to the object.
      echo $result['ObjectURL'] . "\n";
  } catch (S3Exception $e) {
      echo $e-&gt;getMessage() . "\n";
  }
  </code></pre>
  
  <p>If anyone can help me out, that would be great. Thanks.
  --Len</p>