Reputation: 43
Good Morning,
I am use a API JASPER "JasperClient.php" where i use the function runReport to return a xls and in php code i want to download Excel File from the server.
Setting the header:
header('Content-type: application/vnd.ms-excel'); header('Content-Disposition: attachment; filename=myfile.xls');
When i'm download the file and try to open the says:
The file you are trying to open, 'filename.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
Can you help me please? Thank you .
Upvotes: 3
Views: 10321
Reputation: 106
Are you creating Excel 2007 files? If so try using mimetype application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and file extension .xslx
Upvotes: 2