Generate and download word and excel file using http headers

kandarpmistry

New member
Dear Sirs,

I want to know if we can use the following http headers to generate word and excel files in Exeoutput for php:
1.header(“Content-type: application/vnd.ms-word”);
header(“Content-Disposition: attachment;Filename=document_name.doc”);
2.header(“Content-type: application/vnd.ms-excel”);
header(“Content-Disposition: attachment;Filename=document_name.xls”);

If not, what is the alternate method, if any, in exeoutput for php.

Awaiting your kind reply,

Regards,

Kandarp Mistry
 
Last edited:
If you want to generate Word and Excel files from your PHP application, I recommend you this:
  1. use the standard Save As dialog box functions provided by ExeOutput to ask your user where he wants to save the XLS / DOC file: don’t try to send custom headers to the browser to trigger a download window, it won’t work.
    Study this article: http://www.exeoutput.com/help/savedialogbox
  2. The standard Save As dialog box will return the path to the file chosen by the user. Just use this full path to generate the XLS / DOC file as usual with your PHP code.
    It’s a different way than sending data to the browser: you send it to a file.
 
Last edited:
Back
Top