In my of the application I was trying to download the zip file from http and just create stream for unzipping that file into a folder.

After making some google search I was able to write following code which helps me in my task

Here are few steps you have to follow

1. Install unzipper package

2. import unzipper and http into the code file

import unzipper from ‘unzipper’;
import http from ‘http’;

3. Now you have to download the zip file and create stream for this, here is the complete code

import unzipper from ‘unzipper’;
import http from ‘http’;

var self=this;
http.get(‘http://yoururl.com/file.zip’, function(res) {
             res.pipe(unzipper.Extract({ path: ‘C:/cmsdata/’ })).on(‘close’, function() {
                       //Here you can perform any action after completion of stream unzipping
             });
});


4 Comments

Christoper Petruccelli · May 10, 2020 at 9:48 am

Saved as a favorite!, I like it!

Bryant Henriksen · May 12, 2020 at 8:11 am

Bookmarked!, I really like your website!

Shondra Falley · May 13, 2020 at 9:21 pm

First time visiting your website, I like your blog!

Malcom Partridge · May 14, 2020 at 9:49 am

Bookmarked!, I enjoy your site!

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial
back to top
Get Free Quote