I'm trying to use this module to download a file with the following code:
// Main process
ipcMain.on('downloadFile', (event, args) => {
download(BrowserWindow.fromId(event.frameId), args.url, { directory: args.path }).then((dl) => {
console.log(dl.getSavePath())
event.reply('downloadFile-reply', dl.getSavePath());
});
});
Every time the render process fires the downloadFile
event however, I get the following error:
(node:12263) UnhandledPromiseRejectionWarning: TypeError: Error processing argument at index 0, conversion failure from
at /Users/daniel_cai/Documents/GitHub/Destiny-API-Ripper-Extension/node_modules/electron-dl/index.js:204:22
at new Promise (<anonymous>)
at module.exports.download (/Users/daniel_cai/Documents/GitHub/Destiny-API-Ripper-Extension/node_modules/electron-dl/index.js:190:54)
at IpcMainImpl.<anonymous> (/Users/daniel_cai/Documents/GitHub/Destiny-API-Ripper-Extension/src/index.js:170:5)
at IpcMainImpl.emit (events.js:315:20)
at Object.<anonymous> (electron/js2c/browser_init.js:157:9051)
at Object.emit (events.js:315:20)
Google search queries did not yield any results. The full source can be found at Dcai169/Destiny-API-Ripper-Extension@136c9b4.
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