Reputation: 271
I can't download/export in xls
or xlsx
, only in csv
format
$data = Orders::get();
$xls = Excel::create('Orders', function($excel) use($data) {
$excel->sheet('orders', function($sheet) use($data) {
$sheet->fromArray($data);
});
})->download('xls');
return redirect()->back();
I tried to ob_clean in the laravelexcelwriter.php on method _download(line 317) , above the save function(line 341), no result. Also in the save function(line 341) I tried similar options for I/O streams (default is php://output
) like php://stdout
, php://stderr
, php://fd
, php://memory
and still no result.
is this a php.ini problem? a server problem ? where should I check ?
Upvotes: 2
Views: 3062
Reputation: 1636
I think you got the error on Google Chrome Browser, which is the same error as I made. Have you installed php ziparchive module? Please try to install that. If you are in php 7, then following might help you.
sudo apt-get install php7.0-zip
Thanks
Upvotes: 2
Reputation: 8719
Editing the time limit and memory limit fixed it for me. Try what happens if you put this before the Excel::create() method:
set_time_limit(0);
ini_set('memory_limit', '1G');
Upvotes: 0