so I am trying to write a file to the filesystem. The console shows "error" then "write end". it seems to be an INVALID_STATE_ERR (code 7). the "data" is a file that has been dropped on a hotspot. if I change it to var bb = new Blob(["boo"], {type: "text/plain"}); it works fine. Any help is appreciated. Thanks you
this.fileSystem.root.getFile(name, { create: true },
function (fileEntry) {
fileEntry.createWriter(function (fileWriter) {
fileWriter.onwriteend = function (e) {
console.log('write end');
successCallback(fileEntry.name);
};
fileWriter.onprogress = function (e) {
console.log('progress');
};
fileWriter.onwrite = function (e) {
console.log('writing');
}
fileWriter.onerror = function (e) {
console.log('error');
//debugger;
};
var bb = new Blob([data], { type: datatype } );
fileWriter.write(bb);
}.bind(this));
}.bind(this), function (e) {
});