我面临的问题与ionic4文件传输,文件传输不是与安卓9,我已经测试了下安卓9,它的工作很好。
ionic cordova plugin add cordova-plugin-file-transfer
npm install @ionic-native/file-transfer我的代码是
uploadImageFile() {
var options: FileUploadOptions = {
fileKey: "userPhoto",
mimeType: "image/jpeg",
chunkedMode: false,
}
this.URL = 'http://webservicelink.in:1224/mobile/upload';
this.FileUpload.upload(this.imageURI, this.URL, options)
.then((data) => {
alert("Success uploading image");
})
.catch((err) => {
alert("Error uploading image");
});
}误差
{"code":3"source":"file///stoRAGE/EMULATED/0/xENDER/PHOTO/20190704-wa003.jpeg",“http://webservicelink.in:1224/mobile/upload”:“http://webservicelink.in:1224/mobile/upload”,"http_status":null,"body":null,“Exception”:“写错误:ssl0x7cf2dd3f88:系统调用期间的I/O错误,中断管道”}
发布于 2019-07-30 05:12:57
文件传输是简化的
https://github.com/apache/cordova-plugin-file-transfer 对于XMLHttpRequest中引入的新特性,不再需要这个插件。从这个插件迁移到使用XMLHttpRequest的新特性,将在这个Cordova博客文章中解释。
https://stackoverflow.com/questions/57254154
复制相似问题