Closed mcolominas closed 1 year ago
I have managed to make it download, but I don't think it is the best option:
$export = (new FastExcel(Users::all()))->download('users.xlsx');
$export->headers->set('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', true);
$export->headers->set('Content-Disposition', 'attachment; ' .
'filename="' . rawurldecode($file_name) . '"; ' .
'filename*=UTF-8\'\'' . rawurldecode($file_name), true);
$export->headers->set('Cache-Control', 'max-age=0', true);
$export->headers->set('Pragma', 'public', true);
return $export;
I have tried to download the excel following the instructions:
But the file is not downloaded, it only shows the binary content in the browser: ��4:����Ci[l���-���+���01�M�F,J�m�Q�(��a�R���Onޘ�ڃU�&<&ytr��aH�|�B��<���&
I have run this same code using normal laravel, and it has downloaded without problems, but when using the octane laravel, as I have indicated, it only shows the binary result in the browser
If anyone knows of any alternative to download it, I will be grateful if you tell me.