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
-1
@@ -49,6 +49,8 @@ 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)) {
|
||||
@@ -69,9 +71,13 @@ 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);
|
||||
|
||||
Log::info('BulkDownloadSupplierWhiteFormsLogic finished processing files count: '.count($groups));
|
||||
|
||||
return response()->download($zip_file);
|
||||
return response()->download($zip_file2);
|
||||
}
|
||||
else {
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user