
Untitled
By: a guest on
Jul 24th, 2012 | syntax:
None | size: 0.44 KB | hits: 8 | expires: Never
How do you force a file to download from Amazon S3 using the Amazon SDK for PHP?
header("Content-type: $filetype");
header("Content-Disposition: filename="".$filename.""");
$response = $s3->get_object(AMAZON_BUCKET, $filepath);
echo $response->body;
$response = $s3->get_object(AMAZON_BUCKET, $filepath, array(
'response' => array(
'content-type' => $filetype,
'content-disposition' => 'attachment'
)
));