作者 lyh

gx

... ... @@ -68,15 +68,13 @@ class AmazonS3Service
{
$key = str_replace_url($files);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($key, true) . PHP_EOL, FILE_APPEND);
$body = $files;
try {
$result = $this->s3->putObject([
'Bucket' => $this->bucket,
'Key' => $key,
'Body' => file_get_contents($body),
'Body' => file_get_contents($files),
]);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
return $result['ObjectURL'];
} catch (AwsException $e) {
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('图片:'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);
... ...