Client download of a server generated zip file

后端 未结 4 1045
傲寒
傲寒 2020-12-16 21:17

Before somebody says, \"duplicate\", I just want to make sure, that folks know, that I have already reviewed these questions:

1) Uses angular and php, not sure what

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 21:55

    var zip_file_path = "" //put inside "" your path with file.zip
    var zip_file_name = "" //put inside "" file name or something
    var a = document.createElement("a");
    document.body.appendChild(a);
    a.style = "display: none";
    a.href = zip_file_path;
    a.download = zip_file_name;
    a.click();
    document.body.removeChild(a);
    

提交回复
热议问题