I want to download the file directly from s3 to user machine. So I have googled and came up with something like this. But this is not working.
$objInfo = $s3->getObjectInfo('bucket', 'filename.mp3'); $obj = $s3->getObject('bucket', 'filename.mp3'); header('Content-type: ' . $objInfo['type']); echo $obj->body;
Please help me on this. How to force download file not based on URL from s3.