Skip to content

Resolve native file paths from content URLs for Cordova platforms

License

Notifications You must be signed in to change notification settings

MobisysGmbH/cordova-plugin-filepath

 
 

Repository files navigation

cordova-plugin-filepath

PLEASE NOTE: Mobisys forked the original repo because it is not maintained anymore

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:https://...', successCallback, errorCallback);
successCallback

Returns the file:https:// file path.

errorCallback

Returns the following object:

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

Possible error codes are:

  • -1 - describes an invalid action
  • 0 - file:https:// 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)

About

Resolve native file paths from content URLs for Cordova platforms

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 97.5%
  • JavaScript 2.5%