【发布时间】:2015-08-04 07:07:21
【问题描述】:
你好,有没有机会在前端不显示下载过程的情况下将文件下载到本地系统?
我正在尝试如下
var f = document.createElement("iframe");
f.setAttribute("id", "theFrame");
document.body.appendChild(f);
document.getElementById("theFrame").location = 'http://www.example.com/yourfile.doc';
我可以下载该文件,但在下载文件时它显示在浏览器的前端。
【问题讨论】:
-
一个简单的谷歌搜索会告诉你这是一个安全风险,不可能。
标签: javascript windows download