Download The Excel File

Topics: Developer Forum
Oct 17, 2013 at 10:33 AM
Hi Guys...I Want To Download My Excel File Is It Possible In PHPExcel, I Tried But I Didn't Get Any Reference...Can U Help Me Guys. ..
Oct 17, 2013 at 4:28 PM
Look at the example 01simple-download-xlsx or 01simple-download-xls
Nov 21, 2013 at 5:29 AM
Hi Dude.....This Example Is Not Sufficient....I Tried All Possiblities Can U Give Exact Code For Downlod Excel File......
Nov 21, 2013 at 10:34 AM
Then please explain what is happening!

That example demonstrates that you send the correct headers for the filetype, and that you save the file to php://output. It is an "exact code", so clearly you're doing something different.

If that doesn't give you a download (open/save) prompt from your web browser, then please explain what it does do,
Nov 21, 2013 at 11:13 AM
Thanks For Your Reply Mark Baker.......I Didnt Try That Example 01simple-download-xlsx And 01simple-download-xls.....I Am Very New To PHPExcel....U Give Instruction i Do Like That....
Nov 21, 2013 at 11:48 AM
Edited Nov 21, 2013 at 12:11 PM
(Edit: crosspost with Mark reply)
At least, try these examples, before declaring that they are not suitable, and to raise on the words of Mark, explains the problem you meet, what you want to get, show the code that you used...

Incidentally, PHPExcel comes with 10 MB of documentation, multiple examples, a multitude of recipes, it is not forbidden to read at least part.
Nov 21, 2013 at 11:56 AM
Edited Nov 21, 2013 at 11:57 AM
Hi Lwol....For A Referance You Given This File (01simple-download-xls And 01simple-download-xlsx)....But I Didn't Find This File Anywhere....I
Nov 21, 2013 at 11:59 AM
In My Project I Want To Upload File In xls And Xlsx Format.....And Also I Want To Download That File.......This Is My Task Lwol.....Can u Help Me.....
Nov 21, 2013 at 12:41 PM
These files are in the Examples directory in the archive of PHPExcel (answer me that you can't found them have been better to write that they were not sufficient, no?).

If you want to upload Excel files, you stand in the same way as for any type of file: you created an appropriate form, a small script that will put the file where you want. You can see an example, the explanations on the PHP site (

To submit your file for download, this can be simplified in two cases: either the Web server can directly serve the file. A simple link is ok (, or the Web server cannot serve the file, it must be a script that takes it and "pushes" to the client's browser, you will find an example in the documentation for php
In which you will need to change the Content-type header in application/ for a xls file or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for a xlsx file

None of these operations requires PHPExcel. It will intervene only if you must retrieve data from the file uploaded or if you need to modify or build on the fly file available in download.