How to download a big file use electron


#1

I want to dowonload a 3.5G file,How to do? Breakpoint continuingly

var fs = require('fs');
var mkdirp = require('mkdirp');
var http = require('http');
var filePath = "I:/test.gho";
var fileStream = fs.createWriteStream(filePath);
 fileStream.on('open', function(fd) {
       http.get(url + fileName)
                        .success(function(data, status, headers, config){
                            fileStream.write(data);
                            fileStream.end();
                        })
                       .error(function(data, status, headers, config){
                            console.log('product download failed');
                        });
                });