Select Page
View Categories

Chooser

< 1 min read

File chooser plugin for Cordova.

The following must be added to config.xml to prevent crashing when selecting large files on Android:

<platform name="android">
<edit-config
file="app/src/main/AndroidManifest.xml"
mode="merge"
target="/manifest/application">
<application android:largeHeap="true" />
</edit-config>
</platform>

GitHub Source Code: https://github.com/cyph/cordova-plugin-chooser


Requires Cordova plugin: 
cordova-plugin-chooser


Supported Platforms #

  • Android
  • iOS

Usage #


this.chooser.getFile()
  .then(file => console.log(file ? file.name : 'canceled'))
  .catch((error: any) => console.error(error));