Simple excel download

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
varcoe
Forum Newbie
Posts: 1
Joined: Wed Jul 13, 2011 7:18 am

Simple excel download

Post 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!
edziffel
Forum Newbie
Posts: 9
Joined: Wed Jul 13, 2011 6:32 am

Re: Simple excel download

Post by edziffel »

Check out this link for some other ideas.

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