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

Commit

Permalink
Added setting content type for amazon s3 adapter for upload method
Browse files Browse the repository at this point in the history
  • Loading branch information
dmyers committed May 6, 2014
1 parent 3d6dc73 commit c84c5a8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Dmyers/Storage/Adapter/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ public function put($path, $contents)
*/
public function upload($path, $target)
{
$finfo = new \Finfo(FILEINFO_MIME_TYPE);

return $this->client->putObject(array(
'Bucket' => $this->bucket,
'Key' => $this->computePath($target),
'SourceFile' => $path,
'ACL' => $this->config('acl', 'public-read'),
'Bucket' => $this->bucket,
'Key' => $this->computePath($target),
'SourceFile' => $path,
'ContentType' => $finfo->file($path),
'ACL' => $this->config('acl', 'public-read'),
));
}

Expand Down

0 comments on commit c84c5a8

Please sign in to comment.