WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

default forder for FilePicker dialogbox

Open victorthoang opened this issue 3 years ago • 9 comments

Discussed in https://github.com/MicrosoftEdge/WebView2Feedback/discussions/2748

Originally posted by TranquilleXav September 2, 2022 Hello Is there a way to set the default folder for opening the FilePicker dialog box?

when webview2 profile is new, filepicker opens in documents folder when i browse ans select file, the last folder is memorized. where is it stored? I did not find a file containing this information...

and when i force values in registry (via LastVisitedPidlMRU and other keys, I have used this technique before for IE11 and it worked fine), settings in not working with webview2...

thank you in advance

AB#41459117

victorthoang avatar Sep 15 '22 21:09 victorthoang

Hello @victorthoang thank you for your help,

TranquilleXav avatar Sep 16 '22 06:09 TranquilleXav

Hi @TranquilleXav , For the file picker used for downloads you can use CoreWebView2Profile.DefaultDownloadFolderPath property to specify the default download directory (also being the directory the file picker for download will open in when user chooses 'SaveAs'.). However, currently, there is not a way to do it for all file picker instances in WebView2, however I'll add this to our feature request backlog.

yildirimcagri-msft avatar Sep 22 '22 22:09 yildirimcagri-msft

Hello @yildirimcagri

i already use this parameter: WebBrowser.CoreWebView2.Profile.DefaultDownloadFolderPath = WebBrowserCoreWebView2.Profile.ProfilePath & "\download" but it's not that i want, the folder is not "memorized"... and it is bound to the current user. I want to use a generic folder, whatever the user, because this folder is fed elsewhere for everyone...

ok thank for adding this request... but if it's not possible, can you take a look at this? https://github.com/MicrosoftEdge/WebView2Feedback/issues/2650#issue-1328572085 #2650 have the ability to intercept the dialogbox launch and replace it with my own...that would be great! and it would make the upload totally secure

thank you very much for the time you devote to this project anyway and have a nice day

TranquilleXav avatar Sep 23 '22 09:09 TranquilleXav

Hi @TranquilleXav,

Can you please describe the scenario you are trying to address?

Thank you, Nishitha

nishitha-burman avatar Dec 17 '22 01:12 nishitha-burman

sorry, I'm going on vacation, I'll come back to you at the beginning of January

TranquilleXav avatar Dec 17 '22 07:12 TranquilleXav

Hello @nishitha-burman thank you for your question. for example, go to this page and click on the input button: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file

in fact, i want intercept the opening classic dialogbox and put my own dialogbox, and fix the folder it opens in. the user can select file in the folder and clic on ok button , etc. you can take a look at https://github.com/MicrosoftEdge/WebView2Feedback/issues/1479#issuecomment-1365894371 i'm in discussion about this...

If it is not possible, I want to fix the folder in which the dialog box opens... thank you for your help...

TranquilleXav avatar Jan 02 '23 16:01 TranquilleXav

Hi @TranquilleXav,

Thank you for the details. Can you please clarify what you mean by "fix the folder it opens in"? What issues are you seeing currently?

nishitha-burman avatar Jan 26 '23 23:01 nishitha-burman

Hello @nishitha-burman

currently, when the dialog box opens, it jumps to the last visited folder. I want this dialogbox to always open in the same folder, which I would set programmatically or by parameter... if my explanation is not clear enough, tell me and i will put screenshots.

but the solution I would prefer would be to be able to provide myself the dialog box that appears when the user clicks on the "" button of a website. an event "OnOpenFileDialog" could be triggered, with the possibility of providing a parameter "DefaultOpenFolder"

thank you for help!

TranquilleXav avatar Jan 27 '23 06:01 TranquilleXav

Hi @TranquilleXav,

If you can provide screenshots of the user flow that would be helpful. Thanks!

nishitha-burman avatar May 31 '23 16:05 nishitha-burman