作者 lyh

gx

@@ -44,6 +44,7 @@ class AmazonS3Service @@ -44,6 +44,7 @@ class AmazonS3Service
44 { 44 {
45 $key = $s3Key.'/'.$filename; 45 $key = $s3Key.'/'.$filename;
46 $Body = $binary ? $files : fopen($files->getRealPath(), 'r'); 46 $Body = $binary ? $files : fopen($files->getRealPath(), 'r');
  47 + $Body = is_resource($Body) ? stream_get_contents($Body) : $Body;
47 try { 48 try {
48 $result = $this->s3->putObject([ 49 $result = $this->s3->putObject([
49 'Bucket' => $this->bucket, 50 'Bucket' => $this->bucket,