My application is using tpyo/amazon-s3-php-class to put and get objects to/from Amazon S3 storage.
Files are not available publicly and I want my users to be able to download private files through my application.
amazon-s3-php-class offers two options to get the file:
- Save an object to file:
S3::getObject($bucketName, $uploadName, $saveName)
- Save an object to a resource of any type:
S3::getObject($bucketName, $uploadName, fopen('savefile.txt', 'wb'))
But both methods save a file to my web server. How can I force file download to a client's computer?