ionic3:error编码base64中的文件名太长了

时间:2018-03-23 17:25:35

标签: angular cordova typescript ionic-framework

当我使用插件转换为doc64中的base64时,我将文件编码为base64时出现此错误。

错误:

enter image description here

代码角度:

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 ...其中是发送文件名的解决方案

0 个答案:

没有答案
相关问题