title: AWS S3 PHP SDK 2 Copy an object to another bucket error 'Bad request' 400
body: <p>I need to copy an object from a bucket to another bucket. I try with this code:</p>
  
  <pre><code>   $response = $s3-&gt;copyObject(
              array(
                  'Bucket' =&gt; 'ORIGINAL BUCKET',
                  'Key' =&gt; 'OBJECT KEY',
                  'CopySource' =&gt; urlencode('ORIGINAL BUCKET' . '/' . 'OBJECT KEY')
              ), array(
                  'Bucket' =&gt; 'NEW BUCKET',
                  'Key' =&gt; 'NEW OBJECT KEY',
                  'CopySource' =&gt; urlencode('NEW BUCKET' . '/' . 'NEW OBJECT KEY')
              )
  
          );      
  </code></pre>
  
  <p>But I get an error type 400 Bad Request:</p>
  
  <pre><code>object(Aws\S3\Exception\InvalidRequestException)[274]
    protected 'response' =&gt; 
      object(Guzzle\Http\Message\Response)[261]
        protected 'body' =&gt; 
          object(Guzzle\Http\EntityBody)[260]
            protected 'contentEncoding' =&gt; boolean false
            protected 'rewindFunction' =&gt; null 
            protected 'stream' =&gt; resource(299, stream)
            protected 'size' =&gt; null
            protected 'cache' =&gt; 
              array (size=9)
                ...
            protected 'customData' =&gt; 
              array (size=0)
                ...
        protected 'reasonPhrase' =&gt; string 'Bad Request' (length=11)
        protected 'statusCode' =&gt; int 400
  </code></pre>
  
  <p>Somebody have a real example of copyObject to another bucket?</p>