I've been following this guide https://docs.aws.amazon.com/aws-sdk-php/v3/guide/service/s3-transfer.html, but I'd like to be able to automatically download the bucket to a computer's download folder (maybe even tar.gz it). I tried not specifying a destination, but it is a mandatory parameter. Should I just traverse each instead, or is there a way to use AWS transfer manager for PHP in order to achieve my desired behavior?
If you are looking to output it straight to the visitor
<?php
header('Content-Disposition: attachment; filename="FILE.NAME"');
$s3 = new S3($key, $secret);
$s3->getObject("BUCKETNAME", "FILE.NAME", fopen("php://output", "wb"));
?>