I want to create xlsx
file and send to the browser as an attachment, so the user downloads it immediately. I literally did copy-paste the code from this example.
But it doesn't work. I fixed the path in require_once, but the issue is somewhere else.
The xlsx
file is generated corerctly - when I save ot on the server, I can open it. It is also sent to the browser - firebug's console shows some funny characters in output window. The headers are also correct.
But no Save as... dialog is shown. I did some basic checks based on google search results - I have no extra white space after ?>
.
The only difference in my code is that I call php script from jQuery's $.post
function with some additional arguments.
Could it be the reason why I can't download this file?
Any help would be greatly appreciated!
- PHP version: 5.4.20
- PHPExcel version: 1.8.0
- Server: Apache/2.4.6 (Linux/SUSE)
This question is also posted on codeplex.