当我通过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);
})
}
答案 0 :(得分:0)
尝试一下,也许可行
let options = new FileUploadOptions();
// this maybe not your case options.chunkedMode = false;
options.headers = {
Connection: "close"
};