Zlib is a Node native library - has been kept up-to-date for nearly 10 years now - so the proofs there for long-term supports.I'd recommend going straight to using Node's built-in library Zlib for this, which includes images encode in base 64 using "buffers". Put onchange event into the input file and send the files to function files2zip(this.files).Īfter placing all the objects inside your Zip object file, just download it. Z.str2zip('test.txt','content','public/teste/') Create a new file from a string with str2zip(nameFile,content,directory).Load files of your directory to zip object with fecth2zip(filesArray,folder).New Response(blob).arrayBuffer().then(buffer=>)) Str2dec=str=>om(new TextEncoder().encode(str)) The solution is in the public domain.ĭec2bin=(dec,size)=>dec.toString(2).padStart(size,'0') I developed a new solution to generate zip files using JavaScript.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |