cheers all
I'm working on a website that displays excel 2007 files (xlsm) which are written to and stored on our file system.
Users with MS Office 2003 cannot open these files from a webpage, even though they have the compatibility upgrade to see Office 2007 files. Users with Office 2007 can view the files just fine. I figured this has to be a headers issue.
I've added to my script the following header code:
// $ext is the extension parsed from the file name
switch($ext){
case 'xls': // for older files
header("Content-Type: application/vnd.ms-excel;");
break;
case 'xlsm':
header("Content-Type: application/vnd.ms-excel.sheet.macroEnabled.12");
break;
}
// $filename is the file name with path
print file_get_contents($filename);
Do I need any other headers with this? Does anyone know why this will not work for Office 2003 users with the compatibility pack?
I know we can save the files as Excel 2003 compatible, but I'd like to get this working as is for Excel 2007 files.
Thanks for any tips.
jc