I am developing an AngularJS WebApp with SlimPHP as Backend.
I implemented a basic Token-Authentication (custom HTTP - header "x-myapp-auth"). The token is validated by my "User" middleware on every state change in the app via an AJAX-Call. There is the need for converting some JSON - Data to XLS, which I do on the server side within SlimPHP.
Now to my question: How can I
The output code for (2) would be:
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$jsonData->title.'.xls"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');
But when I retrieve that output via AJAX, I can't make the browser initiate a file download.