I'm using AWS SDK PHP v3 to copy objects from bucket to bucket in S3.
When I use the putObject method, I can normally access the file via the URL, but when using the copyObject, I don't have public access marked.
My code is as below.
$credentials = new Aws\Credentials\Credentials(S3_KEY, S3_SECRET);
$this->client = new S3Client([
'region' => 'us-east-1',
'version' => '2006-03-01',
'credentials' => $credentials
]);
$this->client->copyObject([
'Bucket' => S3_NEW_BUCKET,
'CopySource' => S3_OLD_BUCKET.'/'.$source,
'Key' => $destination,
]);
How should I do to allow access to the files?