cordova - 离子文件传输上传错误代码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);
})
}
解决方案
试试这个,也许有用
let options = new FileUploadOptions();
// this maybe not your case options.chunkedMode = false;
options.headers = {
Connection: "close"
};
推荐阅读
- sql - Impala 双精度值未正确加载
- nginx - Nginx 403 权限被拒绝,chown/chmod 似乎不起作用
- node.js - 使用 NodeJS 查找在线游戏中的最短路径
- cocoa - didChangeAutomaticCapitalizationNotification 未触发
- python - 为什么 Tkinter.Tk() 不立即打开窗口?
- json - JSON 到具有可变根的 DataTable 网络
- javascript - 如何在同一个节点子进程中执行多个命令?
- bluetooth - 将 CSRMesh 蓝牙与 Google Home 集成
- c# - UWP 中 Win 10 IOT 线程死锁
- python - 如何根据 Pandas Python 中特定列中的重复值检索行?