Reputation: 163
I am saving the xlsx file in firefox and the browser recognized it as 97-2003 workbook(.xls)
when I open the xls file it generates pop-up window
I have also tried this in the different machine in which it works fine in firefox where it detects it as Microsoft Office Excel Worksheet( which is for .xlsx)
I have also tried to open the browser preferences where I found in application tab of second machine microsoft excel worksheet in content type list
but in the first machine content-type list contains only microsoft excel 97-2003 worksheet. Is that the issue ? If yes, please guide how to fix that ?
Also want to update on this : First Machine Firefox Version is 39.0.3 Second Machine Firefox Version is 40.0.2
Edit :
In the code , I am using PHPExcel library for generating excel file where I am passing application/vnd.ms-excel as mime type in the header.
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=\"example.xlsx\"");
header("Cache-Control: max-age=0");
If this is the issue,then please let me know ?
Upvotes: 4
Views: 2461
Reputation: 212452
application/vnd.ms-excel
is the mime/content type for a BIFF
format .xls
file.
The mime/content type for an OfficeOpenXML
format .xlsx
file is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Firefox is only interpreting the content type that you send in your headers, and this doesn't match with the extension or format of the file that you're sending.
For reference with PHPExcel
OfficeOpenXML format files
Excel2007
Writer.xlsx
Extensionapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet
content/mime typeBIFF format files
Excel5
Writer.xls
Extensionapplication/vnd.ms-excel
content/mime typeUpvotes: 6