iOS DocumentPicker
Opens the file picker on iOS for the user to select a file, returns a file URI. Allows the user to upload files from iCloud
Repo: https://github.com/iampossible/Cordova-DocPicker
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-documentpicker.DocumentPicker $ npm install --save @ionic-native/document-picker@4
- Add this plugin to your app's module
Supported platforms
- iOS
Usage
import { DocumentPicker } from '@ionic-native/document-picker';
constructor(private docPicker: DocumentPicker) { }
...
this.docPicker.getFile('all')
.then(uri => console.log(uri))
.catch(e => console.log(e));
Instance Members
getFile(option)
Open a file
Param | Type | Details |
---|---|---|
option |
string
|
files between 'image', 'pdf' or 'all'Optional |
Returns: Promise<string>