Download The Excel File

Topics: Developer Forum
Oct 17, 2013 at 9: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 3:28 PM
Look at the example 01simple-download-xlsx or 01simple-download-xls
Nov 21, 2013 at 4:29 AM
Hi Dude.....This Example Is Not Sufficient....I Tried All Possiblities Can U Give Exact Code For Downlod Excel File......
Coordinator
Nov 21, 2013 at 9: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 10: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 10:48 AM
Edited Nov 21, 2013 at 11:11 AM
(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 10:56 AM
Edited Nov 21, 2013 at 10: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 10: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 11:41 AM
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 (http://www.php.net/manual/en/features.file-upload.post-method.php)

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 (http://example.com/myfile.xls), 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 http://us1.php.net/manual/en/function.readfile.php
In which you will need to change the Content-type header in application/vnd.ms-excel 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.