cordova-plugin-file
cordova-plugin-file copied to clipboard
Cannot use plugin due to lack of documentation
Hello,
I have a lot of trouble understanding the documentation of this plugin.
At the beginning you say that I get the global object cordova.file when device is ready.
Then under "Where to store files" you explain the properties of the cordova.file locations.
And then you explain which exact paths these cordova.file locations map to, depending on the platform. Until here everything made perfect sense.
I was expecting something like "write to cordova.file.yourfavouritelocation" later in the documentation. Instead you show an example of how to write a persistent file without reference to the above ... ?
You're using requestFileSystem and LocalFileSystem and somehow my file appears in data/data/<app-id>/files/files. Which cordova.file.location was used here?
In addition, according to your table under "Android file system layout", files/files should not exist - only "files" and "files/Documents". Maybe a new Android 10 location? I'm targeting API level 29.
The next difficulties come at the section about how to read a file. You say that I need a FileEntry object. Search the documentation with ctrl + f for the word "FileEntry". I see no documentation, I don't know what that is and how I get it. Intuitively I would expect something like var fe = FileEntry(cordova.file.myfavouritelocation, "myfilename.txt") but I am completely lost here.
Best regards, Robert
I agree. This has been one of the most difficult plugins for me to use so far. All I'm trying to do is read a local JSON file, which seems like should be super simple. I have it working on Android by reading Q&As, but iOS throwing errors.
The documentation is a wall of text that is mostly useless. If I get the plugin fully working and know what I'm doing I'll post some suggested documentation edits.
Hi,
we are aware that our docs situation is not optimal 🙇♂️ - PRs with improvements are greatly appreciated.