我将浏览的zip文件作为缓冲的十六进制内容。 如何将压缩文件复制到我的远程计算机
答案 0 :(得分:1)
您可以使用此https://github.com/cthackers/adm-zip
// creating archives
var zip = new AdmZip();
// add file directly
zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here");
// add local file
zip.addLocalFile("/home/me/some_picture.png");
// get everything as a buffer
var willSendthis = zip.toBuffer();
// or write everything to disk
zip.writeZip(/*target file name*/"/home/me/files.zip");