mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-27 08:24:06 +00:00
Export file directly from Laravel Vapor without going through S3 bucket
This commit is contained in:
@@ -65,11 +65,11 @@ class ExportCustomersToExcelController
|
||||
if (!file_exists($exportDirectory)) {
|
||||
mkdir($exportDirectory, 0755, true);
|
||||
}
|
||||
$localPath = $exportDirectory . '/' . $exportFileName;
|
||||
// $localPath = $exportDirectory . '/' . $exportFileName;
|
||||
$response = $exportsTransactions->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
|
||||
file_put_contents($localPath, $response);
|
||||
return response()->file($localPath, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
// file_put_contents($localPath, $response);
|
||||
return response()->file($response->getFile()->getPathname(), ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
}
|
||||
else{
|
||||
$response = $exportsTransactions->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
||||
|
||||
Reference in New Issue
Block a user