https://stackoverflow.com/questions/46102851/electron-download-a-file-to-a-specific-location
i try to use electron-dl
, everything does well, my main.js
code :
ipcMain.on("download", (event, info) => {
console.dir(event);
console.log(info);
info.properties.onProgress = status => {
console.log('progress');
return event.sender.send("download progress", status)
};
download(BrowserWindow.getFocusedWindow(), info.url, info.properties)
.then(dl => {
console.log("dl.getSavePath()", dl.getSavePath());
return event.sender.send('download complete', dl.getSavePath());
}).catch((error)=>{
console.log('error');
console.log(error);
});
});
but when i turn off my wifi, the code console.log('progress');
keep run, never stop.
so is there any way to stop run onProgress function?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too