mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 05:53:58 +00:00
Laravel Vapor - sync code for download files in bulk from S3 to more files
This commit is contained in:
+7
-9
@@ -49,8 +49,6 @@ class BulkDownloadSupplierWhiteFormsLogic
|
||||
$endDate = $endDate->format('d-m-Y');
|
||||
$zipFileName = "currency_vendor_orders_{$startDate}_to_{$endDate}_{$companyReference}.zip";
|
||||
$zip_file = "{$zipDirectory}/{$zipFileName}";
|
||||
$zipFileName2 = "currency_vendor_orders_{$startDate}_to_{$endDate}_{$companyReference}_dup.zip";
|
||||
$zip_file2 = "{$zipDirectory}/{$zipFileName2}";
|
||||
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($zip_file, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE)) {
|
||||
@@ -74,13 +72,13 @@ class BulkDownloadSupplierWhiteFormsLogic
|
||||
|
||||
Log::info('BulkDownloadSupplierWhiteFormsLogic finished processing files count: '.count($groups));
|
||||
|
||||
return redirect(Storage::disk('s3')->temporaryUrl(
|
||||
$filePathForS3,
|
||||
now()->addHour(),
|
||||
['ResponseContentDisposition' => 'attachment']
|
||||
));
|
||||
|
||||
// return response()->download($url);
|
||||
return response()->streamDownload(function () use ($filePathForS3) {
|
||||
return Storage::disk('s3')->temporaryUrl(
|
||||
$filePathForS3,
|
||||
Carbon::now()->addMinutes(60),
|
||||
['ResponseContentDisposition' => 'attachment']
|
||||
);
|
||||
}, $zipFileName);
|
||||
}
|
||||
else {
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user