Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: add option to change cordova.file.dataDirectory to cordova.file.externalDataDirectory #35

Open
hreimer opened this issue Dec 19, 2017 · 2 comments

Comments

@hreimer
Copy link

hreimer commented Dec 19, 2017

Hi, upon testing your plugin I found that if a internal webserver is used*, the log file is stored under cdvfile://localhost/files/.txt, which (in my case) is inaccessible although it gets written, it's just useless for further debugging if it only persists in an inaccessible location during runtime.

I found in your sourcecode, if I changed all appearances of cordova.file.dataDirectory to cordova.file.externalDataDirectory the file gets created and I can find it under /Android/data//files/.txt.
For now I will fork your plugin, however I thought maybe others faced the same issues and a fileDirectory option would be a nice addition.

*see these plugins: cocoon-cordova-labs-local-webserver, cocoon-cordova-labs-wkwebview-engine-localhost, cocoon-cordova-plugin-wkwebview-engine

Using Ionic 1.3.3 & cordova 6.5.0, my device is a Samsung Galaxy J3 2016

@robindierckx
Copy link

+1

@pliablepixels
Copy link

pliablepixels commented Oct 27, 2018

We can't change everything to cordova.file.externalDataDirectory as that breaks iOS. cordova.file.dataDirectory is correct and works on both Android and iOS.

When you do $filelogger.checkFile() it returns a name. All you need to do is:

var myFileWithPath = cordova.file.dataDirectory + result.name // result is the return object from checkFile

And you'll get the full path with file. Verified with wkwebview and iOS and Android. Sample code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants