|
...
|
...
|
@@ -70,16 +70,10 @@ class AmazonS3Service |
|
|
|
$key = str_replace_url($files);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($key, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
// try {
|
|
|
|
$context = stream_context_create([
|
|
|
|
"ssl" => [
|
|
|
|
"verify_peer" => false, // 关闭对对等证书的验证
|
|
|
|
"verify_peer_name" => false, // 关闭对主机名的验证
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
$result = $this->s3->putObject([
|
|
|
|
'Bucket' => $this->bucket,
|
|
|
|
'Key' => $key,
|
|
|
|
'Body' => file_get_contents($files, false, $context),
|
|
|
|
'Body' => fopen($files,'rb'),
|
|
|
|
]);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
return $result['ObjectURL'];
|
...
|
...
|
|