python-base64与js-base64--数据传递文件保存

result["data"] = base64.b64encode(rv).decode()
var a = window.atob(data["data"]);
var byteNumbers = new Array(a.length);
for (var i = 0; i < a.length; i++) {
    byteNumbers[i] = a.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
var blob = new Blob([byteArray], {type: "application/octet-stream"});
saveAs(blob, data["fileName"]);

你可能感兴趣的:(python,web)