This library allows you to download the provided list of files from S3 storage into a single zipped file.
What is important, the downloaded files are not stored on the disk on the server, but are streamed directly to the zip file to be downloaded by the user's browser.
- PHP 7.4 or higher,
- PHP Zip extension,
- PHP AWS SDK 3.0 or higher (installed as a composer dependency),
- AWS S3 bucket with files to download.
- install library with composer:
composer require s3-mass-downloader/s3-mass-downloader
- use the library in your code (see the
examples/basic-usage.php
file)
- create an instance of the
StreamingClient
class. As a parameters please provide an instance of theS3Client
class from the AWS SDK and the name of the bucket from which you want to download the files. - call
downloadZippedFiles($listOfFilesToDownload)
method. As a parameter please provide an array with the list of absolute files path that you want to be downloaded. - please see the
examples/basic-usage.php
file for more details.