“Debugging connection was closed: Render process was gone”, when trying to download a 7gb from cdn

Multi tool use
Multi tool use


“Debugging connection was closed: Render process was gone”, when trying to download a 7gb from cdn



We are trying to download a 7 GB from CDN using JSZip.js. The chrome browser suddenly seems to close the connection when the download reaches 3.5gb every time. The approximate time is around 15 mins. Is there a way we increase the tolerant time to 1 hr say?



$("#downloadJSZip").on('click', function () {


var result = [{ "cdn": "url....", "filename": "7.84 gb.zip", "size": 4194304, "path": "7.84 gb" }];
var Promise = window.Promise;
if (!Promise) {
Promise = JSZip.external.Promise;
}


function urlToPromise(url) {
return new Promise(function(resolve, reject) {
JSZipUtils.getBinaryContent(url, function (err, data) {
if(err) {
reject(err);
} else {
resolve(data);
}
});
});
}


var fileNameArray = ;

function changeFileName(fileName,j){
var i = fileName.lastIndexOf('.');
var newfilename = fileName.slice(0,i)+"--"+j+fileName.slice(i);

if(fileNameArray.indexOf(newfilename) != -1){
j = j+1;
changeFileName(fileName,j);
}
return newfilename;
}


var zip = new JSZip();
// find every checked item
result.forEach(function(file){
var filename = file.filename;
if(fileNameArray.indexOf(filename) != -1){
var newfilename = changeFileName(filename,1);
filename = newfilename;
}
fileNameArray.push(filename);
var url = file.cdn;
var folder = (file.path);
zip.folder(folder).file(filename, urlToPromise(url), {binary:true});
// zip.file(filename, urlToPromise(url), {binary:true});

});

// when everything has been downloaded, we can trigger the dl
zip.generateAsync({type:"blob",
}, function updateCallback(metadata) {
var msg = "progression : " + metadata.percent.toFixed(2) + " %";
if(metadata.currentFile) {
msg += ", current file = " + metadata.currentFile;
}

console.log(msg);
console.log(metadata.percent|0);
})
.then(function callback(blob) {

// see FileSaver.js
//console.log("blob=====>");
//console.dir(blob);
//saveAs(blob, "example.zip") ;
saveAs(blob, $scope.folderName+".zip") ;

//console.log("done !");


}, function (e) {


});



});



Is this chrome browser configuration?





Chrome has a hardcoded memory limit for a tab process which is about 3.5GB even in 64-bit Chrome. This is done to prevent a bad page script from exhausting all the system memory. As for a solution, try FileSystem API, which is available in Chrome, to download the data to a temporary disk file directly.
– wOxxOm
Jul 2 at 12:02





Can you share a sample api by using filesystem? As per this post html5rocks.com/en/tutorials/file/filesystem there is no support for filesystem api. We want to zip and download a large file onto to users disk (if possible to do the zip process also on disc instead of process memory). Possibly using all the browser types
– Santosh
Jul 2 at 21:34






Like I said it's Chrome only, and yes Chrome may remove it in the future, but right now it works. I don't have an example but you should be able to find those yourself.
– wOxxOm
Jul 3 at 5:19





The site caniuse.com/#feat=fileapi suggests that api support is going to continue..
– Santosh
Jul 3 at 19:43









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

QLre8DOMrmo082aK5D1j2V2GW0VhSxwmXu63CyP1M,91N3hsrjXqqfRUNVaaFEPfgqrVsk STDdHsfL0 j8rdHY
gSM tGIDSTAoS5R02fOikNnEgOP7YFG baUI7QYJ JEv,STilNNy6ykA

Popular posts from this blog

Rothschild family

Cinema of Italy