I\'m trying to provide a simple download using AJAX POST request. A user clicks a and the download begins (or a download dialog shows up, depending
I don't think its possible using ajax, I had the same issue and the download was not triggered. My solution was using only PHP:
Create a new file when the page is loaded, on the background. This will be stored in a server location.
$out = fopen('filename', 'w+');
//write data in file
fputcsv($out, some csv values );
have a link to the client to download it
Export Data to CSV file
And depending on how often this is done, you must clean-up the downloads regularly to not fill the server.