📜  如何使用 php 代码示例从 s3 存储桶下载文件

📅  最后修改于: 2022-03-11 14:54:17.752000             🧑  作者: Mango

代码示例1
Got it to work by echo'ing out the content-type header before echo'ing the $object body.

$objInfo = $s3->get_object_headers('my_bucket', 'test.jpg');
$obj = $s3->get_object('my_bucket', 'test.jpg');

header('Content-type: ' . $objInfo->header['_info']['content_type']);
echo $obj->body;