Open m-kovac opened 1 month ago
What path shows in dialog if calling callback->Continue("C:\Users\user\Downloads\Downloads\file.txt", true)
?
before testing it make sure C:\Users\user\Downloads\Downloads\
path exists.
This is currently the expected behavior. CEF is intentionally clearing the |default_file_name| value as a Chromium API requirement (code here). Only the Save dialog can currently specify a |default_file_name| value, and in that case it's currently only using the filename (not the path). Chromium is then automatically adding the path value that was last selected in a file dialog (code here).
Describe the bug
CefBeforeDownloadCallback
callback's Continue method always opens Save As dialog in current user folder if file name is part of path.To Reproduce Steps to reproduce the behavior:
When the
OnBeforeDownload
callback'sContinue
method is invoked with the exact path e.g.C:\Users\user\Downloads\file.txt
and with the argumentshowDialog
astrue
,the dialog opens the current user folder, not the required path - user's Downloads folder in this case.It does not matter which path is used, as far as the file name is part of the path, the current user folder is opened in dialog. If the path is defined without the file name, correct folder is opened in the dialog, but without preferred name and extension.
CefSharp
wrapper is used to implement the Download handler and respective methods, but the reported issue was marked as upstream issue. See https://github.com/cefsharp/CefSharp/issues/4951 for more details.Expected behavior
callback->Continue("C:\Users\user\Downloads\file.txt", true);
will open Save File dialog in the Download folder withfile.txt
as suggested name.Screenshots If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Additional context
Does the problem reproduce with Google Chrome at the same version?
Add any other context about the problem here.