cyph / cordova-plugin-chooser

Cordova file chooser plugin.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

app crash while selecting big files which has 100MB+ size

zubinraja opened this issue · comments

As per documentation, have set the largeheap:true as below. Which works for files that are around 50MBs.
While selecting files more that 100MB+ size. app still crashes. is there a way to prevent crash or to filter the files with size param along with mime type.



I started using specific file chooser plugins for android and ios. it allows me to check file size, before actually reading it.

Android:
ionic cordova plugin add cordova-plugin-filechooser
npm install --save @ionic-native/file-chooser@4

ios:
ionic cordova plugin add cordova-plugin-filepicker
npm install --save @ionic-native/file-picker@4

@zubinraja Hi, if its working fine for you then please share the working code. Thank you

android
`
this.fileChooser.open().then(uri => {

    this.filePath.resolveNativePath(uri).then(nativePath => {
        this.sendDocument(nativePath);
    })
    .catch((error: any) => {
      this.toast.show("Unable to select document. Please try again later.");
    });

  })`

ios:
`
this.iosFilePicker.pickFile().then(uri => {

    if(uri.indexOf("file://") !== 0)
      this.sendDocument("file://" + uri);
    else
      this.sendDocument(uri);
  })
  .catch(err => {
    this.toast.show("Unable to select document. Please try again later.");
  });`

its been 2 years already. And switched to native apps.