作者 lyh

gx

@@ -40,11 +40,10 @@ class AmazonS3Service @@ -40,11 +40,10 @@ class AmazonS3Service
40 * @method :post 40 * @method :post
41 * @time :2024/1/23 9:20 41 * @time :2024/1/23 9:20
42 */ 42 */
43 - public function uploadFiles(&$files, $s3Key,$filename ,$binary = false) 43 + public function uploadFiles(&$files, $s3Key,$filename )
44 { 44 {
45 $key = $s3Key.'/'.$filename; 45 $key = $s3Key.'/'.$filename;
46 - $Body = $binary ? $files : fopen($files->getRealPath(), 'r');  
47 - $Body = is_resource($Body) ? stream_get_contents($Body) : $Body; 46 + $Body = fopen($files->getRealPath(), 'r');
48 try { 47 try {
49 $result = $this->s3->putObject([ 48 $result = $this->s3->putObject([
50 'Bucket' => $this->bucket, 49 'Bucket' => $this->bucket,