fast-excel
fast-excel copied to clipboard
download excel problem in live server
when test it on local server it works fine but when host my application to live server its giving me ERR_INVALID_RESPONSE why?
return (new FastExcel($list))->download('file.xlsx');
Same thing started happening for me in on production servers. Noticed it about a month ago.
I have same problem
For what it's worth, I solved this by fixing 2 issues:
First Issue: I was double returning the download, so:
return response()->download($fastExcelJob->download($filename));
The $fastExcelJob->download is returned by another class. I had fixed this issue on a few other controllers, but this instance has not been fixed. This issue might not be applicable to everyone.
Second Issue: In my recordGenerator() function (iterator function for all records), I had some helper functions that make certain attributes human readable friendly (example, concat first_name and last_name into one user_name field).
There was an error when trying to render one of these attributes due to missing field values. For some reason, these were not being caught when using the $fastExcelJob->download() method. I caught the errors by switching the $fastExcelJob from download to export:
$fastExcelJob->export($filename)
At that point, it started catching the errors and I could see them in the logs. No clue why it didn't do that with download().
Hope this helps someone. Cheers
In my case ZipArchive was not installed on server But there was not error on the page