neutralinojs / neutralino.js

JavaScript API for Neutralinojs
https://neutralino.js.org/docs/api/overview
MIT License
237 stars 47 forks source link

filesystem.writeBinaryFile appears to corrupt file #42

Closed sclarke500 closed 2 years ago

sclarke500 commented 2 years ago

Writing a binary file creates a file that appears to be corrupt.

PNG file in Windows 11 reports: "It appears we don't support this file format" docx (MS Word) file reports: "Word experienced an error trying to open this file"

I encountered the error after downloading a blob, converting to an array buffer and writing, but can also recreate with this code:

let data = await Neutralino.filesystem.readBinaryFile('temp/test.png');
await Neutralino.filesystem.writeBinaryFile(`temp/testCopy.png`, data);

For both tests (png and docx) Windows reported the file size of the copy to have increased slightly (71 bytes and 32 bytes respectively), but the on disk sizes or originals and copies are the same.

from neutralino.config.json:

    "binaryVersion": "4.4.0",
    "clientVersion": "3.3.0"
sclarke500 commented 2 years ago

looks like wrong place, and already reported here: https://github.com/neutralinojs/neutralinojs/issues/619