What is the best way to download a big file in NodeJS?

前端 未结 3 657
滥情空心
滥情空心 2021-02-15 08:03

The below server code is working fine for 5GB file using wget http://localhost:11146/base/bigFile.zip but not using client side code.

Serve

3条回答
  •  灰色年华
    2021-02-15 08:27

    var request = require('request')
    request('http:/localhost:11146/base/bigFile.zip', function (error, response, body) {
      console.log('error:', error); // Print the error if one occurred
      console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
      console.log('body:', body); // Print the HTML for the Google homepage.
    });
    

    It should be http://localhost:11146/base/bigFile.zip instead of http:/localhost:11146/base/bigFile.zip

提交回复
热议问题