Spanchal
Spanchal

Reputation: 495

ionic + Android 9 + File Transfer

i am facing the issue with ionic4 file transfer, file transfer is not working with android 9, i have tested below android 9 it is working fine.

ionic cordova plugin add cordova-plugin-file-transfer
npm install @ionic-native/file-transfer

MY CODE IS

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");
  });
}

ERROR

{"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":"Write error: ssl0x7cf2dd3f88:I/O error during system call,Broken pipe"}

Upvotes: 0

Views: 1835

Answers (1)

Chanaka Weerasinghe
Chanaka Weerasinghe

Reputation: 5742

Filetransfer is Depricated

https://github.com/apache/cordova-plugin-file-transfer

Deprecated With the new features introduced in XMLHttpRequest, this plugin is not needed any more. Migrating from this plugin to using the new features of XMLHttpRequest, is explained in this Cordova blog post.

Upvotes: 1

Related Questions