# cordova-plugin-filepath

> Resolve native file paths from content URLs for Cordova platforms

Latest version **1.6.0** (published 2021-03-11) · Apache 2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install cordova-plugin-filepath
pnpm add cordova-plugin-filepath
yarn add cordova-plugin-filepath
bun add cordova-plugin-filepath
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2021-03-11 |
| First published | 2015-04-01 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 66 |
| Author | Ramesh Nair |
| Maintainers | hiddentao |
| Keywords | cordova, file, ecosystem:cordova, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-filepath
- Repository: https://github.com/hiddentao/cordova-plugin-filepath
- Homepage: https://github.com/hiddentao/cordova-plugin-filepath#readme
- Issues: https://github.com/hiddentao/cordova-plugin-filepath/issues
- npm.io page: https://npm.io/package/cordova-plugin-filepath

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.6.0 (latest) — 2021-03-11
- 1.5.8 — 2020-03-06
- 1.5.7 — 2020-01-23
- 1.5.6 — 2019-08-04
- 1.5.5 — 2019-05-11
- 1.5.4 — 2019-05-06
- 1.5.3 — 2019-05-06
- 1.5.2 — 2019-05-06
- 1.5.1 — 2019-01-03
- 1.5.0 — 2019-01-03
- 1.4.2 — 2018-07-24
- 1.4.1 — 2018-07-24
- 1.3.0 — 2018-04-03
- 1.2.0 — 2018-02-08
- 1.1.0 — 2017-09-20
- … 3 more at https://npm.io/package/cordova-plugin-filepath/versions

## README

# cordova-plugin-filepath

**PLEASE NOTE: This plugin is no longer actively maintained.**

This plugin allows you to resolve the native filesystem path for Android content
URIs and is based on code in the [aFileChooser](https://github.com/iPaulPro/aFileChooser/blob/master/aFileChooser/src/com/ipaulpro/afilechooser/utils/FileUtils.java) library.

Original inspiration [from StackOverflow](http://stackoverflow.com/questions/20067508/get-real-path-from-uri-android-kitkat-new-storage-access-framework).

## Installation

```bash
$ cordova plugin add cordova-plugin-filepath
```

## Supported Platforms

* Android

## Usage

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

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

##### successCallback
Returns the ``file://`` file path.

##### errorCallback
Returns the following object:
```js
{ 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)

---
_Source: https://npm.io/package/cordova-plugin-filepath · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
