I have a little function, that creates .xls document(using PHPexcel) and then sends it to php://output. Then user download it.
Everything works fine, except that safari on
For anyone having this problem it is the browser doing its own thing. Using JavaScript worked for me but you need to add html than use JavaScript to output to the browser.