Page 1 of 1

Simple excel download

Posted: Wed Jul 13, 2011 7:34 am
by varcoe
Hi, first post!

I'm trying to get an excel file to download, I don't want to generate or edit it in anyway, just download it as it stands on the server.

I have no problem with PDFs using the following method;

Code: Select all

header('Content-disposition: attachment; filename='.$filename);
header('Content-type: application/pdf');
readfile('secureitems/'.$filename);
For excel files the Content-type is changed to 'application/vnd.ms-excel'
I'm getting a document with the name of the requested document but it's empty, apart from cell A1 witch contains to file name? I'm very confused.

Any help would be great!

Re: Simple excel download

Posted: Wed Jul 13, 2011 8:09 am
by edziffel
Check out this link for some other ideas.

http://phpexcel.codeplex.com/wikipage?t ... Title=Home