If you are not able to download the excel in Firefox and where it is working fine in Chrome and IE then have a look at below code.
To work in Firefox Excel Issue
Just add below code in headers
header(“Content-type: application/vnd.ms-excel”);
See below for full code
header("Content-disposition: attachment;filename=example.xls");
header("Content-type: application/vnd.ms-excel");
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Transfer-Encoding: binary");
And the Filename Should never Contain a Space.
e.g., filename-22.xls is correct and
filename 22.xls is not not correct.
Once you added code just try clearing your browser and cache and run.