Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

iOS DocumentPicker

Improve this doc

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

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-documentpicker.DocumentPicker
    $ npm install --save @ionic-native/document-picker@4
    
  2. Add this plugin to your app's module

Supported platforms

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>

API

Native

General