离子文件传输上传错误代码3

时间:2018-06-27 10:22:44

标签: cordova ionic-framework ionic3

当我通过Filetransfer上传图像时,我仅在ios中得到错误代码3,但在android上运行正常 我的代码在下面。

postUploadProfile(imageData) {
    this.httpService.showLoading();
      let options: FileUploadOptions = {
      }

    const fileTransfer: FileTransferObject = this.transfer.create();
        fileTransfer.upload(imageData,this.API_URL, options)
       .then((data) => {
         // success
         this.httpService.hideLoading();

       }, (err) => {
           this.httpService.hideLoading();

         console.log('filetransfer error: ',err);
       })
  }

1 个答案:

答案 0 :(得分:0)

尝试一下,也许可行

   let options = new FileUploadOptions();
   // this maybe not your case options.chunkedMode = false;
    options.headers = {
          Connection: "close"
       };