Tag: 拉链

将zip文件解压到本地文件夹

我有节点应用程序快递和即时消息发送来自客户端的请求,如邮递员,我需要从请求获取文件,并提取它在我的本地文件夹,我怎么能做到这一点? 我发现以下开源,但不知道如何把req正文,并提取它在我的本地文件夹,如“C:// Test // extractDest”, 下面的代码是从以下开源获取的,但如果有其他好的开源的,我可以用它来代替 https://www.npmjs.com/package/decompress-zip var DecompressZip = require('decompress-zip'); var unzipper = new DecompressZip(filename) unzipper.on('error', function (err) { console.log('Caught an error'); }); unzipper.on('extract', function (log) { console.log('Finished extracting'); }); unzipper.on('progress', function (fileIndex, fileCount) { console.log('Extracted file ' + (fileIndex + 1) + ' of ' + fileCount); }); unzipper.extract({ path: "C://Test//extractDest", filter: function […]