Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save an Excel file created with PHPExcel, without dialog?

Tags:

php

phpexcel

I am trying to generate an Excel file (xls), using PHPExcel, but have it saved on the server instead of having it prompted for download on my desktop!

How can I instruct PHPExcel to save my file instead of having the dialog presented by the browser?

like image 762
user198003 Avatar asked May 06 '12 17:05

user198003


1 Answers

Ok, I get it:

I have to use:

$objWriter->save('nameoffile.xls');

... and not to define headers, because header "telling" to browser to save file.

Thank you anyway!

like image 106
user198003 Avatar answered Sep 28 '22 11:09

user198003