Here is a little crazy. I am making an Ajax call using jQuery.post as follows:
$.post('php/print.php',{data:dS},function(res){... },"text");
I am returning from print.php (as a test):
header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=test.doc"); echo "<html>"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; echo "<body>"; echo "Testing-2-3!"; echo "</body>"; echo "</html>";
Data goes through a penalty according to Firebug, including headers. But how do I get a browser (Firefox in this case) to prompt the user to save the attachment?
Thanks.
source share