mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
use x-vapor-base64-encode for xlsx exports instead of ->get stream
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user