1

I have a Laravel project which allows to upload photos and they are stored S3 bucket.

At particular times, it's needed to download an entire album which is a folder in S3 bucket storage. So, it should be downloaded as a ZIP file that includes photos of that album.

I managed to do this when these are stored on local storage.

 public function downloadZip() {
            $files = glob(public_path('js/*'));
            Zipper::make('mydir/mytest3.zip')->add($files);


            return response()->download(public_path('mydir/mytest3.zip'));
 }

But, in S3 bucket, that method is not working.

Is there a way to do this ?

Tharindu Thisarasinghe
  • 3,846
  • 8
  • 39
  • 70

2 Answers2

0

You can try Amazone service feature Async transfers. This will help you to get the s3 files and after that you can use your Zipper logic to zip that files.

AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57
-1

AWS exposes SDKs for different platforms like Java/PHP etc to interact with different AWS Services.

You need to access https://aws.amazon.com/sdk-for-php/ for your PHP code to copy files from s3

Deepak Singhal
  • 10,568
  • 11
  • 59
  • 98