Could you please help me troubleshoot why this code is not functioning correctly?
Note: file is a native plugin
var blob = new Blob(["This is the content of my blob"], { type: "text/plain" });
this.file.writeFile(this.file.dataDirectory, 'myletter.txt', blob, { replace: true })
.then(() => {
//actions to take upon successful write
})
.catch((err) => {
console.error(err); //error handling here
});
The exception being thrown is:
FileError
code : 5
message : "ENCODING_ERR"
__proto__ : Object