This repository has been archived on 2023-11-19. You can view files and clone it, but cannot push or open issues or pull requests.
goober-ionic/plugins/cordova-plugin-filepath
2018-07-15 19:24:48 -07:00
..
src/android add native android build sources 2018-07-15 19:24:48 -07:00
CHANGELOG.md add native android build sources 2018-07-15 19:24:48 -07:00
LICENSE.md add native android build sources 2018-07-15 19:24:48 -07:00
package.json add native android build sources 2018-07-15 19:24:48 -07:00
plugin.xml add native android build sources 2018-07-15 19:24:48 -07:00
README.md add native android build sources 2018-07-15 19:24:48 -07:00

cordova-plugin-filepath

This plugin allows you to resolve the native filesystem path for Android content URIs and is based on code in the aFileChooser library.

Original inspiration from StackOverflow.

Installation

$ cordova plugin add cordova-plugin-filepath

Supported Platforms

  • Android

Usage

Once installed the plugin defines the window.FilePath object. To resolve a file path:

window.FilePath.resolveNativePath('content://...', successCallback, errorCallback);
successCallback

Returns the file:// file path.

errorCallback

Returns the following object:

{ code: <integer>, message: <string> }

Possible error codes are:

  • -1 - describes an invalid action
  • 0 - file:// path could not be resolved
  • 1 - the native path links to a cloud file (e.g: from Google Drive app)

LICENSE

Apache (see LICENSE.md)