作者 lyh

gx

... ... @@ -34,8 +34,8 @@ class CosService
],
]);
$key = $path.'/'.$filename;
$Body = fopen($files->getRealPath(), 'r');
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($Body, true) . PHP_EOL, FILE_APPEND);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($files, true) . PHP_EOL, FILE_APPEND);
$Body = $binary ? $files : fopen($files->getRealPath(), 'r');
$options = [
'Bucket' => $cos['bucket'],
'Key' => $key,
... ... @@ -53,9 +53,9 @@ class CosService
]
]);
}
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($options, true) . PHP_EOL, FILE_APPEND);
// 上传文件
$cosClient->putObject($options);
$res = $cosClient->putObject($options);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($res, true) . PHP_EOL, FILE_APPEND);
return $key;
}
... ...