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 do not get why you want to trigger an ajax call for download?
Why don't you just do a regular Download and set the mime type of that page. This way you can run any php code and then echo a mime type, this will not cause the page to reload and you will stay in the page from where you did the click.
http://davidwalsh.name/php-header-mime