create and write with Cordova file Ionic plugin

Asked

Viewed 79 times

1

I am trying to write to a file using the Cordova file, as I cannot write straight to the Assets (which is read-only), I move the file and try to write, but it falls in the catch erro2.

 this.file.copyFile(this.file.applicationDirectory + '/www/assets/', 'catalogo.txt', 
    this.file.applicationStorageDirectory, 'catalogo.txt')
    .catch(e => window.alert('erro1'));


    this.file.writeFile(this.file.applicationStorageDirectory,"catalogo.txt",
    'escrita no arquivo????', {append: true})
    .catch(e => window.alert('erro2'));

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.