Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.
I am using the download feature as a file drop. I would like to manage the directory the files are dropped.
I'm using the miniBrowser Demo as a prototype.
Though I want to manage the download directory myself, right now it is always going to my Downloads directory. Even when I set the directory under Edge Settings to a different directory.
This is what the WebView2 documentation say about ResultFilePath :
If setting the path, the host should ensure that it is an absolute path, including the file name, and that the path does not point to an existing file. If the path points to an existing file, the file will be overwritten. If the directory does not exist, it is created.
I have used the above and it works, however I get memory leaks for the 3 added events from
FDownloadOperation.AddAllBrowserEvents(WVBrowser1);
How/when do I clean these up.
Also I do want to overwrite file location, I'm updating Geo locations, but this creates ne file with (1) appended. Anyideas on how to be sure it overwrites? Alternatively, I could save and copy myself, but I would need to know when file is finished downloading.