sTx
sTx

Reputation: 1221

Locate new created directory of Ionic Native - File

I'm trying to save some form inputs on my device(in a new file) so I can be able to copy or send that file to someone.

Relevant code using is:

    this.file.checkDir(this.file.dataDirectory, 'mydir')
    .then(_ => console.log('Directory exists'))
    .catch(err => {.log('Directory doesnt exist');
      this.file.createDir(this.file.dataDirectory,"mydir",true);
}); 

The thing is that code works, the first time when it runs can't find the directory so it creates it. All good but the problem that I can't find my new created directory on my Internal storage.

I've read this post and I'm kinda disappointed if that is true. Anyone having experience with Native FIle and could help me? Thanks

P.S. I've forgot to mention that my app is not build for production, I'm using ionic cordova run android

Upvotes: 0

Views: 1304

Answers (1)

sTx
sTx

Reputation: 1221

ok, the solution was to use this.file.externalDataDirectory instead of this.file.dataDirectory that worked without having an external card. The path for the new created directory is here: YourDevice\Android\data\io.ionic.starter\files.

Upvotes: 1

Related Questions