I'm trying to make it so that my script will show test.jpg in an Amazon S3 bucket through php. Here's what I have so far:
require_once('library/AWS/sdk.class.php');
$s3 = new AmazonS3($key, $secret);
$objInfo = $s3->get_object_headers('my_bucket', 'test.jpg');
$obj = $s3->get_object('my_bucket', 'test.jpg', array('headers' => array('content-disposition' => $objInfo->header['_info']['content_type'])));
echo $obj->body;
This just dumps out the file data on the page. I think I need to also send the content-disposition header, which I thought was being done in the get_object() method, but it isn't.
Using this SDK - https://aws.amazon.com/sdk-for-php/