Hi there,
I have trouble opening a xlsx fomatted files using Excel 2007 and Excel 2010 when I try to open it through PHP.
The warning goes as-
"Excel found unreadable content in report.xlsx. Do you want to recover the contents of this workbook?If you trust the source of this workbook, click Yes".
opening this file directly by double clicking on it has no Issues.
But I need to open it via php.
I've set content types as below, and the error occurs at that point:
header("Content-type:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
header("Content-Disposition:attachment;filename=report.xlsx");
readfile("C:\wamp\www\proj\includes\out\fileone.xlsx");
Do I have a wrong Content type?or what could be the issue? Is this related to apache?
You help is very much appreciated and thanks in advance.