【发布时间】:2020-10-09 20:10:57
【问题描述】:
我正面临 ionic4 文件传输的问题, android 9 无法进行文件传输, 我在 android 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","target":"http://webservicelink.in:1224/mobile/upload","http_status":null ,"body":null,"Exception":"写入错误:ssl0x7cf2dd3f88:I/O error during system call,Broken pipe"}
【问题讨论】:
标签: ionic-framework ionic4 ionic-native