作者 lyh

gx

@@ -34,8 +34,8 @@ class CosService @@ -34,8 +34,8 @@ class CosService
34 ], 34 ],
35 ]); 35 ]);
36 $key = $path.'/'.$filename; 36 $key = $path.'/'.$filename;
37 - $Body = fopen($files->getRealPath(), 'r');  
38 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($Body, true) . PHP_EOL, FILE_APPEND); 37 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($files, true) . PHP_EOL, FILE_APPEND);
  38 + $Body = $binary ? $files : fopen($files->getRealPath(), 'r');
39 $options = [ 39 $options = [
40 'Bucket' => $cos['bucket'], 40 'Bucket' => $cos['bucket'],
41 'Key' => $key, 41 'Key' => $key,
@@ -53,9 +53,9 @@ class CosService @@ -53,9 +53,9 @@ class CosService
53 ] 53 ]
54 ]); 54 ]);
55 } 55 }
56 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($options, true) . PHP_EOL, FILE_APPEND);  
57 // 上传文件 56 // 上传文件
58 - $cosClient->putObject($options); 57 + $res = $cosClient->putObject($options);
  58 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($res, true) . PHP_EOL, FILE_APPEND);
59 return $key; 59 return $key;
60 } 60 }
61 61