Simple excel download
Posted: Wed Jul 13, 2011 7:34 am
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;
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!
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);
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!