我在aws s3存储桶中有图像收集器。我需要使用Guzzle http将那些保存的图像发送到另一个请求。保存在文件夹images /中的图像。 这就是我发送请求的步骤:
// $client is new instance guzzle http
$response = $client->request('POST', 'www.example.com', [
'multipart' => [
'name' => 'image.png',
'file' => fopen(Storage::disk('s3')->url('images/'. $imageFileName), 'r')
]
])
问题是,'file' => fopen(Storage::disk('s3')->url('images/'. $imageFileName), 'r')
是从aws s3打开文件的正确方法吗?
还是有另一种方式?
请帮忙。谢谢!