-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Missing file extension in download save dialog #10121
Comments
@steverandy do you have Finder configured to show extensions? |
We've run into this as well on 1.7.4 and macOS 10.12 With "Show all filename extensions" enabled the extension is added when a file is downloaded, when it's off downloaded files are stripped of their extensions and saved as a bare filename. Reverting to 1.6.11 resolves the issue for us |
@zeke I don't have the finder config enabled. When it is enabled, it fixes the issue. |
I can confirm that the issue is present since v1.7.4. |
Confirmed here on macOS 10.12.6 + Electron 1.7.5 too. Curiously, it only happens in a packaged (with electron-packager in my case) .app. The file extension is present when launching the app locally with |
This looks like a possible regression from #9610, @shubham2892 would you be able to take a look? |
Same here, macOS Sierra 10.12.6, electron v1.7.5 Finder's "show all filename extensions" fixes it, but I don't expect users to have it enabled by default. |
Encountered the same issue with Electron 1.7.6. When Finder's "Show all filename extensions" is enabled, then files are saved as "file.txt". When the setting is disabled, files will get saved as "file" (without extension). This behaviour has been different in the past (with Electron 1.6). At that time files were always saved with their extension. |
I tried to cheat the save dialog the following way:
Unfortunately it still doesn't work. You can test it in your own Electron app using the following snippet from the DevConsole within Electron: const url = window.URL.createObjectURL(new Blob());
const anchor = document.createElement('a');
document.body.appendChild(anchor);
anchor.href = url;
anchor.download = 'file.txt';
anchor.style = 'display: none';
anchor.click(); Although |
really harmful change~Many user feedback file download but can't open cause extend name is lost. Any hack? |
We've had customers report this issue on Windows 10 as well. There's a similar OS setting: http://www.thewindowsclub.com/show-file-extensions-in-windows |
I just spent a fair time trying to debug this, it looks like our dialog logic is correct (still) but is not being triggered by our download manager delegates. Will investigate more when I get a chance, at the moment my thoughts are somewhere in a Chromium update our code stopped being executed |
Now, I prompt the saveDialog and get the filename, add extend name(get by request) when no extend name set by use. Really strange, but work... |
Hey @dengyaolong, |
@MarshallOfSound, have you looked into that change as a possible cause? |
@marcoconti83 I upload my sample code to https://github.com/dengyaolong/electron-downloader/blob/master/index.js |
@dengyaolong thanks! |
@dengyaolong With your However, the |
@bennyn I update the listener, now , you can set 'opts.dir' to set saveDir without dialog. |
Fixed by #10469. |
@steverandy @javan |
I'm stiill having the issue in Windows as of |
Expected behavior
Save dialog should show filename with the correct extension.
Actual behavior
Extension is missing in the filename on the save dialog window.
How to reproduce
Download a file from a webview.
The text was updated successfully, but these errors were encountered: