I'm currently making a HTA application and I need to save Base64-encoded ZIP archive to file.
var stream = new ActiveXObject('ADODB.Stream');
stream.Type = 1;
stream.Open();
stream.Write(atob(data));
stream.SaveToFile('dump.zip');
stream.Close();
This code throw error on stream.Write(data) Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
There are some solutions for VBScript, but I'm trying to make it on javascript.
Thanks to this post
I still don't understand why I must save binary data as text, but it works.