Skip to content

vascoferreira/cordova-plugin-filepath-generic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

cordova-plugin-filepath-generic

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

This version comes from a necessity because of the error "column data does not exist" when getting the file path on some phones.

I basicaly edited the getPath method and when the uri scheme is "content" it always call's the method getDriveFilePath that forces the creation of a temporary file with the content of uri received. then it returns the filepath of the temporary file.

Installation

$ cordova plugin add cordova-plugin-filepath-generic

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)

About

No description, website, or topics provided.

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published