An open API service indexing awesome lists of open source software.

https://github.com/mbossx/cordova-plugin-file

cordova file plugin for file read and write
https://github.com/mbossx/cordova-plugin-file

Last synced: 2 months ago
JSON representation

cordova file plugin for file read and write

Awesome Lists containing this project

README

        

# Chooser

## Overview

File chooser plugin for Cordova.

Install with Cordova CLI:

$ cordova plugin add cordova-plugin-chooser

Supported Platforms:

* Android

* iOS

## API

/**
* Displays native prompt for user to select a file.
*
* @param accept Optional MIME type filter (e.g. 'image/gif,video/*').
*
* @returns Promise containing selected file's raw binary data,
* base64-encoded data: URI, MIME type, display name, and original URI.
*
* If user cancels, promise will be resolved as undefined.
* If error occurs, promise will be rejected.
*/
chooser.getFile(accept?: string) : Promise

## Example Usage

(async () => {
const file = await chooser.getFile();
console.log(file ? file.name : 'canceled');
})();

## Platform-Specific Notes

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

```



```