https://github.com/mobius3/cordova-plugin-filename
Plugin to obtain the real filename on android
https://github.com/mobius3/cordova-plugin-filename
Last synced: about 1 year ago
JSON representation
Plugin to obtain the real filename on android
- Host: GitHub
- URL: https://github.com/mobius3/cordova-plugin-filename
- Owner: mobius3
- License: other
- Created: 2019-10-28T11:55:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-28T14:23:49.000Z (over 6 years ago)
- Last Synced: 2025-03-27T15:22:10.647Z (about 1 year ago)
- Language: Java
- Size: 7.81 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Cordova Filename Plugin
Simple plugin that returns the real file name of an android `content://` URI or any other return from file picking intent API.
It uses the method described at https://developer.android.com/training/secure-file-sharing/retrieve-info
## Install
Install it via cordova CLI:
```
cordova plugin add cordova-plugin-filename
```
## Use
A new function will be available at `window.cordova.plugins.filename` with the following prototype: `getFilename(url, successCallback, errorCallback)`
```
cordova.plugins.filename.getFilename(``, name => console.log('file name is:', name))
```
Be sure to pass a `content://` URL rather than a `cdvfile://` or `file://` URL. You might need to call `window.resolveLocalFileSystemURL` before.