Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saveAs window prompt always showing up #122

Open
vitorizkiimanda opened this issue Sep 9, 2020 · 8 comments
Open

saveAs window prompt always showing up #122

vitorizkiimanda opened this issue Sep 9, 2020 · 8 comments

Comments

@vitorizkiimanda
Copy link

i have state saveAs: false ( eventhough the default value is false ), but saveAs Window keep showing up when download about to begin

@sindresorhus
Copy link
Owner

From what I can tell, our logic is sound:

electron-dl/index.js

Lines 54 to 56 in d87af7a

if (!options.saveAs) {
item.setSavePath(filePath);
}
So this sounds like an Electron bug. I would recommend upgrading to the latest Electron version.

@vitorizkiimanda
Copy link
Author

From what I can tell, our logic is sound:

electron-dl/index.js

Lines 54 to 56 in d87af7a

if (!options.saveAs) {
item.setSavePath(filePath);
}

So this sounds like an Electron bug. I would recommend upgrading to the latest Electron version.

well I'll try to update the electron to the latest. Thanks. Gonna update here about the result

@basilky
Copy link

basilky commented Oct 4, 2020

I can confirm this issue on Electron 10.3.1(Windows, Mac and Linux). Works fine with Electron 9.3.1(tested on Linux and Windows).

@vitorizkiimanda
Copy link
Author

I can confirm this issue on Electron 10.3.1(Windows, Mac and Linux). Works fine with Electron 9.3.1(tested on Linux and Windows).

thanks for the info.. i can confirm the bug appears when download multiple files in parallel ( appears in electron 10, 8, 7 ).
IF only download single file the bug doesn't appear. My solution right now is by queue the download so only 1 download in a time. But its kinda messy.

any robust solution for multiple download in parallel?

@jonesaustindev
Copy link

@vitorizkiimanda @sindresorhus any update on this? I am facing a similar issue with downloading multiple files and getting the Save As dialog. Using Electron 10.1.3

@jonesaustindev
Copy link

For anyone in the future having the same issue with downloading multiple files, I went the path of doing them in order instead of setting up promises to resolve every file at once. Here's what I ended up with that worked for my use case:

      async function downloadFiles(assetUrls: string[]) {
        for (const url of assetUrls) {
          await download(mainWindow, url, {
            directory: assetsDirectory,
            saveAs: false,
            showBadge: false,
          });
        }
      }

@basilky
Copy link

basilky commented Dec 10, 2020

Maybe related to this electron bug?
electron/electron#23273

@vitorizkiimanda
Copy link
Author

vitorizkiimanda commented Dec 10, 2020

For anyone in the future having the same issue with downloading multiple files, I went the path of doing them in order instead of setting up promises to resolve every file at once. Here's what I ended up with that worked for my use case:

      async function downloadFiles(assetUrls: string[]) {
        for (const url of assetUrls) {
          await download(mainWindow, url, {
            directory: assetsDirectory,
            saveAs: false,
            showBadge: false,
          });
        }
      }

well thanks @jonesaustindev , i created same approach with different style and it solve the problem ( eventhough not really solved the bug )

note : still waiting for the real solution for the bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants