Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zubinraja opened this issue May 13, 2021 · 3 comments
Open

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

zubinraja opened this issue May 13, 2021 · 3 comments

Comments

@zubinraja
Copy link

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.



@zubinraja
Copy link
Author

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

@vishwanath1004
Copy link

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

@zubinraja
Copy link
Author

zubinraja commented Oct 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants