|
...
|
...
|
@@ -48,6 +48,7 @@ class CosService |
|
|
|
// 如果不是 Base64 流文件,处理为普通文件上传
|
|
|
|
$Body = $binary ? $files : fopen($files->getRealPath(), 'r');
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$options = [
|
|
|
|
'Bucket' => $cos['bucket'],
|
|
|
|
'Key' => $key,
|
|
...
|
...
|
@@ -66,6 +67,11 @@ class CosService |
|
|
|
], true);
|
|
|
|
}
|
|
|
|
$res = $cosClient->putObject($options);
|
|
|
|
@file_put_contents(storage_path('logs/upload_images'), var_export($res, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
@file_put_contents(storage_path('logs/upload_images'), var_export($e->getMessage(), true) . PHP_EOL, FILE_APPEND);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return $key;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|