Skip to content

Commit

Permalink
Update S3Service.php
Browse files Browse the repository at this point in the history
added copyObject()
  • Loading branch information
anuj9196 authored Aug 11, 2018
1 parent 7a4c1fd commit dea611e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/S3Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,14 @@ public function moveToS3($local_file, $key, $acl = [])
'Body' => fopen($local_file, 'rb'),
'ACL' => $acl_string
]);

$s3Client->copyObject([
'Bucket' => $this->getS3Bucket(),
'Key' => $key,
'CopySource' => $this->getS3Bucket() . '/' . $key,
'ContentDisposition' => 'attachment; filename="'.basename($key).'"',
'MetadataDirective' => 'REPLACE',
]);

return $result->toArray()['ObjectURL'];
} catch (S3Exception $e) {
Expand Down

0 comments on commit dea611e

Please sign in to comment.