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
- Host: GitHub
- URL: https://github.com/mbossx/cordova-plugin-file
- Owner: mbossX
- License: other
- Created: 2019-03-03T14:55:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T03:03:07.000Z (about 6 years ago)
- Last Synced: 2025-01-19T08:21:32.493Z (4 months ago)
- Language: Java
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:```
```