diff --git a/src/Dmyers/Storage/Adapter/AmazonS3.php b/src/Dmyers/Storage/Adapter/AmazonS3.php index 4ec96a9..2bdb276 100644 --- a/src/Dmyers/Storage/Adapter/AmazonS3.php +++ b/src/Dmyers/Storage/Adapter/AmazonS3.php @@ -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'), )); }