正在显示
1 个修改的文件
包含
1 行增加
和
7 行删除
| @@ -70,16 +70,10 @@ class AmazonS3Service | @@ -70,16 +70,10 @@ class AmazonS3Service | ||
| 70 | $key = str_replace_url($files); | 70 | $key = str_replace_url($files); |
| 71 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($key, true) . PHP_EOL, FILE_APPEND); | 71 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($key, true) . PHP_EOL, FILE_APPEND); |
| 72 | // try { | 72 | // try { |
| 73 | - $context = stream_context_create([ | ||
| 74 | - "ssl" => [ | ||
| 75 | - "verify_peer" => false, // 关闭对对等证书的验证 | ||
| 76 | - "verify_peer_name" => false, // 关闭对主机名的验证 | ||
| 77 | - ], | ||
| 78 | - ]); | ||
| 79 | $result = $this->s3->putObject([ | 73 | $result = $this->s3->putObject([ |
| 80 | 'Bucket' => $this->bucket, | 74 | 'Bucket' => $this->bucket, |
| 81 | 'Key' => $key, | 75 | 'Key' => $key, |
| 82 | - 'Body' => file_get_contents($files, false, $context), | 76 | + 'Body' => fopen($files,'rb'), |
| 83 | ]); | 77 | ]); |
| 84 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND); | 78 | @file_put_contents(storage_path('logs/lyh_error.log'), var_export($result, true) . PHP_EOL, FILE_APPEND); |
| 85 | return $result['ObjectURL']; | 79 | return $result['ObjectURL']; |
-
请 注册 或 登录 后发表评论