阿神2017-06-15 09:24:513楼
两种思路:
1.
通过js保存图片到本地function DownLoadReportIMG(imgPathURL) {
//如果隐藏IFRAME不存在,则添加
if (!document.getElementById(“IframeReportImg”))
$(‘‘).appendTo(“body”);
if (document.all.IframeReportImg.src != imgPathURL) {
//加载图片
document.all.IframeReportImg.src = imgPathURL;
}
else {
//图片直接另存为
DoSaveAsIMG();
}
}
function DoSaveAsIMG() {
if (document.all.IframeReportImg.src != “about:blank”)
document.frames(“IframeReportImg”).document.execCommand(“SaveAs”);
}
2.第二种思路,使用获取img对象,然后通过ajax+fromData发送到服务端,然后发起请求下载该图片
-------------暂时想到这两种,没有找到js写文件的权限,想到在补充