Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snuffy/cordova-plugin-sdcard
https://github.com/snuffy/cordova-plugin-sdcard
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/snuffy/cordova-plugin-sdcard
- Owner: snuffy
- Created: 2020-03-31T09:13:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-02T10:49:03.000Z (about 4 years ago)
- Last Synced: 2024-11-13T00:29:56.909Z (2 months ago)
- Language: Java
- Size: 268 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Write/modify on external storage
Fork [this plguin](https://github.com/deadlyjack/code-editor/tree/master/plugins/cordova-plugin-sdcard) for using this plugin only
Using this plugin, cordova apps can check for external storages and write/modify files.
## Installation
## Usage
```js
window.SDcard = {
open: function (uuid, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "open", [uuid]);
},
openDoc: function (onSuccess, onFail, mimeType) {
cordova.exec(onSuccess, onFail, "SDcard", "open document", mimeType ? [mimeType] : []);
},
list: function (onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "list", []);
},
write: function (root, file, content, onSuccess, onFail) {
if (file) {
cordova.exec(onSuccess, onFail, "SDcard", "write", [root, file, content]);
} else {
cordova.exec(onSuccess, onFail, "SDcard", "write", [root, content]);
}
},
rename: function (root, file, newFile, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "rename", [root, file, newFile]);
},
delete: function (root, file, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "delete", [root, file]);
},
mkdir: function (root, parent, dir, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "mkdir", [root, parent, dir]);
},
touch: function (root, parent, file, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "touch", [root, parent, file]);
},
move: function (root, src, dest, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "move", [root, src, dest]);
},
copy: function (root, src, dest, sub, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "copy", [root, src, dest, sub]);
},
getPath: function (root, file, onSuccess, onFail) {
cordova.exec(onSuccess, onFail, "SDcard", "getpath", [root, file]);
}
};```