Write binary content to file


#1

Hi everyone, After decryption I have converted all the data into byte array.Then I tried to write them with writesync method. but unfortunately its not working.
Here is my code:

const decryptedData = CryptoJS.AES.decrypt(encryptedData, secretKey);
const decryptedDataText = decryptedData.toString(CryptoJS.enc.Utf8);
const data = base64js.toByteArray(decryptedDataText);
this.newFVideoFile = this.folder.getFile((this.fileName || “output”) + “.mp4”);
this.newFVideoFile.writeSync(data, (err) => {
// console.log(err);
});