压缩Javascript ArrayBuffer

问题描述 投票:0回答:1

我正在使用REST API,它通过八位字节流向我发送一个zip文件。我正在尝试使用angular4检索此文件,虽然这很好,但我需要将传入的ArrayBuffer转换为zip文件。我一直在看JsZip,但它似乎没有提供我需要的功能,我似乎无法弄清楚最好的方法是什么。

this.issueIdentity('person', 'bk').subscribe((response)=>{
    console.log("sucessfully issued identity to participant", response);
    this.enrollmentData = response.arrayBuffer();
})

欢迎帮助

javascript hyperledger-composer jszip
1个回答
0
投票

问题是没有在Angular http客户端中设置正确的响应类型。我现在收到一个可以和JsZip一起使用的blob。

http.post(url,data,{responseType:ResponseContentType.Blob}).subscribe((response)=>{
   response.blob();
})
© www.soinside.com 2019 - 2024. All rights reserved.