I am trying to copy an object using the Amazon s3 copyObject () method.
Below is the code:
$copied = $s3->copyObject(array(
'Bucket' => $this->bucket,
'CopySource' => urlencode($this->bucket .'/'.$source_file),
'Key' => $this->dir.$jduid.'/'.$new_file
));
This method works fine. If I print the result of copyObject, I get:
Guzzle\Service\Resource\Model Object
(
[structure:protected] =>
[data:protected] => Array
(
[LastModified] => 2016-10-26T07:32:34.373Z
[ETag] => "08fa3106a8b7839b803f4ddf65b56919"
[Expiration] =>
[CopySourceVersionId] =>
[ServerSideEncryption] =>
[SSECustomerAlgorithm] =>
[SSECustomerKeyMD5] =>
[SSEKMSKeyId] =>
[RequestCharged] =>
[RequestId] => c0a80b5b:1558b420117:3e7c6:9a9
)
)
But I can not find the new copied file in the bucket. Any suggestion.
source
share