开发者

Using PHPExcel in Joomla

I've been trying to get PHPExcel to work with my Joomla. If the script saves it into file, it works fine but when I'm trying to output it to the browser for download, the file will give a warning 'File extension or file format is not valid'. My guess would be something to do with the Content-Type being served. Any ideas on how to make it work?

Headers I've placed in view.xlsx.php:

// Redirect output to a client’s web browser (Excel2007)
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="01simple.xlsx"');
header('Cache-Control: max-age=0');

This is actually a copy and paste from their example which I can assure works fine in their own script. The problem is when I'm running it in J开发者_JAVA百科oomla.


Take a look at this entry from the Joomla forums; and watch out for potential clashes with the autoloader

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜