学无先后,达者为师

网站首页 编程语言 正文

通过url路径下载服务器文件

作者:沉、睡 更新时间: 2022-02-01 编程语言

通过url路径下载服务器文件

html

<iframe   width=0   height=0   frameborder=0   name=hrong   style="display:   none"></iframe>

js

window.frames["hrong"].location.href   = "文件地址";
sa();
 function   sa()
{
    if(window.frames["hrong"].document.readyState!="complete")
        setTimeout("sa()",   100);
    else
        window.frames["hrong"].document.execCommand('SaveAs');
}

原文链接:https://blog.csdn.net/zz975896590/article/details/119991168

栏目分类
最近更新