首页 > 解决方案 > 离子文件传输上传错误代码3

问题描述

当我使用 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);
       })
  }

标签: cordovaionic-frameworkionic3

解决方案


试试这个,也许有用

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

推荐阅读