ファイルをダウンロードしようとしていますが、中断され続けるため、理由がわかりません。私はそれが中断された理由をデバッグする方法に関する情報を見つけることができません。電子のダウンロードが中断し続ける
私は、ファイルを保存していますのはここC:\ Users \ユーザーrnaddy \のAppData \ローミング\タキオン\ゲーム\ murware \超連鎖反応の\ web.zip
ですここで
window.webContents.session.on('will-download', (event, item, webContents) => {
let path = url.parse(item.getURL()).pathname;
let dev = path.split('/')[3] || null;
let game = path.split('/')[4] || null;
if (!dev && !game) {
item.cancel();
} else {
item.setSavePath(Settings.fileDownloadLocation(dev, game, 'web'));
item.on('updated', (event, state) => {
let progress = 0;
if (state == 'interrupted') {
console.log('Download is interrupted but can be resumed');
} else if (state == 'progressing') {
progress = item.getReceivedBytes()/item.getTotalBytes();
if (item.isPaused()) {
console.log('Download is paused');
} else {
console.log(`Received bytes: ${item.getReceivedBytes()}; Progress: ${progress.toFixed(2)}%`);
}
}
});
}
});
は、上記の引き金となるというのが私のリスナーである:ここでは
ipcMain.on(name, (evt) => {
window.webContents.downloadURL('http://api.gamesmart.com/v2/download/murware/super-chain-reaction');
});
は、私が取得しています出力されます私はクロームでパスhttp://api.gamesmart.com/v2/download/murware/super-chain-reactionにアクセスしようとすると、私のダウンロードフォルダにうまくファイルのダウンロードを
127.0.0.1 api.gamesmart.com
:私のコンソールで:
Received bytes: 0; Progress: 0.00%
Received bytes: 233183; Progress: 0.02%
Download is interrupted but can be resumed
私は、ホストファイルを設定しています。だから、これを引き起こしているのは何ですか?