From 734038fd334191e47a5964e17fb867b9e4699cbf Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Mon, 29 Apr 2024 10:27:09 +0800 Subject: [PATCH] Laravel Vapor - sync code for download files in bulk from S3 to more files --- .../BulkDownloadSupplierWhiteFormsLogic.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php b/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php index 718aaa1a..5c68dd33 100644 --- a/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php +++ b/app/Classes/Modules/Companies/ControllersLogic/BulkDownloadSupplierWhiteFormsLogic.php @@ -72,12 +72,14 @@ class BulkDownloadSupplierWhiteFormsLogic $filePathForS3 = 'bulk_whiteform/'.$zipFileName; Storage::put($filePathForS3, file_get_contents($zip_file), 's3'); - $responseContent = Storage::disk('s3')->get($filePathForS3); - file_put_contents($zip_file2, $responseContent); + // $responseContent = Storage::disk('s3')->get($filePathForS3); + // file_put_contents($zip_file2, $responseContent); + + $url = Storage::disk('s3')->url($filePathForS3); Log::info('BulkDownloadSupplierWhiteFormsLogic finished processing files count: '.count($groups)); - return response()->download($zip_file2); + return response()->download($url); } else { return response()->json([