use x-vapor-base64-encode for xlsx exports instead of ->get stream

This commit is contained in:
Adrià
2025-03-28 10:26:20 +01:00
parent dc5a81e880
commit 934cc23e88
@@ -24,17 +24,15 @@ class XlsxDownloader implements Downloader
$fileName = $export->file_name . '.xlsx';
if ($disk->exists($filePath = $directory . DIRECTORY_SEPARATOR . $fileName)) {
return response()->streamDownload(function () use ($disk, $filePath) {
if (ob_get_level()) {
ob_end_clean();
}
$response = $disk->download($filePath);
echo $disk->get($filePath);
if (ob_get_length() > 0) {
ob_end_clean();
}
flush();
}, $fileName, [
'Content-Type' => 'application/vnd.ms-excel',
]);
$response->headers->set('X-Vapor-Base64-Encode', 'True');
return $response;
}
$writer = app(Writer::class);