base64 - Write binary file with Javascript and ADODB.Stream -



base64 - Write binary file with Javascript and ADODB.Stream -

i'm making hta application , need save base64-encoded zip archive 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 of wrong type, out of acceptable range, or in conflict 1 another. there solutions vbscript, i'm trying create on javascript.

thanks this post

var stream = new activexobject('adodb.stream'); stream.type = 2; //stream type - text info o_0 stream.charset = "windows-1251"; //windows-1252 works stream.write(atob(data)); stream.savetofile('dump.zip'); stream.close();

i still don't understand why must save binary info text, works.

javascript base64 activex hta

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -