当我使用插件转换为doc64中的base64时,我将文件编码为base64时出现此错误。
错误:
代码角度:
testup()
{
for(var s of this.files)
{
this.imgarr.push(s);
}
console.log(this.imgarr);
for(var o of this.imgarr)
{
this.base64.encodeFile(o.name).then((base64File: string) => {
alert(base64File);
this.base64array.push(base64File);
} , (err) => {
this.presentToast(err);
this.presentToast('error encode');
});
}
this.http.post('url api',this.base64array, {responseType: 'text'}).subscribe(res =>
alert(res),
err => {
this.presentToast(err);
});
}
字符串不发送到api,因为文件名太lang ...其中是发送文件名的解决方案