AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
[TOC] > [github](https://github.com/rndme/download) ## 安装 ``` npm install downloadjs bower install downloadjs require("downloadjs")(data, strFileName, strMimeType); ``` ## 下载文件重命名 ``` $.ajax({ url:url, success: download.bind(true, "text/html", "demo.exe") }); ``` or ``` var x=new XMLHttpRequest(); x.open( "GET", "/diff6.png" , true); x.responseType="blob"; x.onload= function(e){download(e.target.response, "awesomesauce.png", "image/png");}; x.send(); ``` ## 填入内容,并下载文件 ``` download("hello world", "dlText.txt", "text/plain"); ``` ## 下载文件或二进制流 ``` download("/robots.txt"); download("/diff6.png"); ```