Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit c84c5a8

Browse files
committed
Added setting content type for amazon s3 adapter for upload method
1 parent 3d6dc73 commit c84c5a8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Dmyers/Storage/Adapter/AmazonS3.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,14 @@ public function put($path, $contents)
7272
*/
7373
public function upload($path, $target)
7474
{
75+
$finfo = new \Finfo(FILEINFO_MIME_TYPE);
76+
7577
return $this->client->putObject(array(
76-
'Bucket' => $this->bucket,
77-
'Key' => $this->computePath($target),
78-
'SourceFile' => $path,
79-
'ACL' => $this->config('acl', 'public-read'),
78+
'Bucket' => $this->bucket,
79+
'Key' => $this->computePath($target),
80+
'SourceFile' => $path,
81+
'ContentType' => $finfo->file($path),
82+
'ACL' => $this->config('acl', 'public-read'),
8083
));
8184
}
8285

0 commit comments

Comments
 (0)