Hello!
I have a Delphi application calling a webview.
Inside this webview there is a button to download a file. However, when I click on download, my application simply closes.
I looked in the documentation for how to download using the TMSFNCWebBrowser component but I couldn't find it.
Could you tell me how to handle downloads in a webview? I imagine you should open Windows Explorer to select where the file will be saved.
I apologize for the delay. We have discovered that with the "WebView2Loader_x86.dll" in version 1.0.774.44, the download functionality was working correctly. However, after we updated the TMS component, where the dll was upgraded to version 1.0.1549.0, the system began to close during any download. Could you please test this with a basic demo on any page that has a download link.
What is the recommendation in this case? Downgrade the dll? Considering that we always use the latest version of the edge webview. Downgrading would be a problem, due to windows update, etc.
The download folder is by default the Downloads folder. You can change this in the OnDownloadStarted event where you can set the ResultFilePath of the Download.
procedure TForm2.TMSFNCEdgeWebBrowser1DownloadStarted(Sender: TObject;
ADownload: TTMSFNCWebBrowserDownload; var ASilent, APause, AResume,
ACancel: Boolean);
begin
ADownload.ResultFilePath := 'C:\tmssoftware\sample.zip';
end;