使用Ajax请求下载文件
var xhr = new XMLHttpRequest();xhr.open("GET", "download.php");xhr.send();
<?header("Cache-Control: public");header("Content-Description: File Transfer");header("Content-Disposition: attachment; filename= file.txt");header("Content-Transfer-Encoding: binary"); readfile("file.txt");?>
千巷猫影
四季花海