Skip to content

writeBinaryArray returns error without any helpful details #3

@belaviyo

Description

@belaviyo

Hi,

I tried to use your plugin in my app and I get this error:

W/CordovaPlugin( 4422): Attempted to send a second callback for ID: BinaryFileWriter131367594
W/CordovaPlugin( 4422): Result was: "Error"
W/CordovaPlugin( 4422): Attempted to send a second callback for ID: BinaryFileWriter131367594
W/CordovaPlugin( 4422): Result was: "Invalid action"

The code I run is:

'use strict';
window.requestFileSystem(
  window.TEMPORARY, 1024, function (fs) {
    fs.root.getFile(
      'ff.txt',
      {create: true, exclusive: false},
      function (fe) {
        fe.createWriter(function (fileWriter) {
          fileWriter.onerror = function (e) {
            console.error(e);
          };
          fileWriter.onwriteend = function (e) {
            console.error('e.loaded', e.loaded);
            fe.file(function (file) {
              console.error('file size is', file.size);
            });
          };
          fileWriter.seek(0);
          fileWriter.writeBinaryArray([244, 244, 244]);
        });
      },
      function (e) {console.error(e)}
    );
  },
  function (e) {console.error(e)}
);

btw, fileWriter.onerror is not providing any info.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions