JSPM

cordova-plugin-simple-file-chooser-1

3.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q58981F
  • License Apache-2.0

Cordova file chooser plugin

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cordova-plugin-simple-file-chooser-1) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Chooser

    Overview

    This plugin is an forked version of cordova plugin chooser that provides multiple file selection functionality and removes base64 functionality as we can use ionic native file plugin to get file directly

    Installing

    cordova plugin add cordova-plugin-simple-file-chooser

    Supported Platforms:

    • Android
    • iOS

    API

    /**
      * Displays native prompt for user to select one or more files.
      *
      * @param accept Optional MIME type filter (e.g. 'image/gif,video/*').
      *
      * @returns Promise containing selected files' information,
      * MIME type, display name, and original URI.
      *
      * If user cancels, promise will be resolved as undefined.
      * If error occurs, promise will be rejected.
      */
    chooser.getFiles(accept?: string) : Promise<undefined|{
        mediaType: string;
        name: string;
        uri: string;
    }>

    Example Usage

    (async () => {
      const file = await chooser.getFile();
      console.log(file);
    })();

    Note

    If calling in typescript don't use types instead use direct javascript by declare var chooser on your ts file.