xs2coder commented on issue #289:
URL:
https://github.com/apache/cordova-plugin-file/issues/289#issuecomment-970214243
> @domingosl @alex-steinberg @RonCan Try this:
>
> ```
> const justTheNameOfTheFile = "file.txt";
> window.requestFileSystem(window.LocalFileSystem.PERSISTENT, 0, async fs =>
{
> window.resolveLocalFileSystemURL(window.cordova.file.dataDirectory,
async dirEntry => {
> dirEntry.getFile(justTheNameOfTheFile, { create: true,
exclusive: false }, fileEntry => {
> // what you want to do
> }
> });
> });
> ```
>
> It is because `window.cordova.file.dataDirectory` returns
`file:///data/user/0/...` and `.getFile` checks if there is a `:` in the string
and throws the encoding error then. But with the solution above it worked for
me.
What is the use of "fs" in second line? Do we really need it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]