Laravel Vapor - sync code for download files in bulk from S3 to more files

This commit is contained in:
Dillon Ngo
2024-04-29 11:47:19 +08:00
parent 85013007d5
commit 577273bb24
@@ -72,13 +72,19 @@ class BulkDownloadSupplierWhiteFormsLogic
Log::info('BulkDownloadSupplierWhiteFormsLogic finished processing files count: '.count($groups));
return response()->streamDownload(function () use ($filePathForS3) {
echo Storage::disk('s3')->temporaryUrl(
$filePathForS3,
Carbon::now()->addMinutes(60),
['ResponseContentDisposition' => 'attachment']
);
}, $zipFileName);
// return response()->streamDownload(function () use ($filePathForS3) {
// echo Storage::disk('s3')->temporaryUrl(
// $filePathForS3,
// Carbon::now()->addMinutes(60),
// ['ResponseContentDisposition' => 'attachment']
// );
// }, $zipFileName);
$tempUrl = Storage::disk('s3')->temporaryUrl(
$filePathForS3,
Carbon::now()->addMinutes(60)
);
return response()->download($tempUrl);
}
else {
return response()->json([