TMSFNCWebBrowser Download File

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.

Can you provide a small sample as a starting point so we can investigate what is going wrong?

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.

Hello, any news about this problem?

We are investigating this here.

We've tried to simulate this, but more information is needed as we were not able to reproduce this issue on our systems.

We will need some more information on how it is used. For example does it fail on all downloads (like 'https://www.learningcontainer.com/sample-zip-files/')?

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;

Hi,
I have same problem (very urgent for me). Tested on DownloadManager demo project. My observation:

  • only on release mode (32bit) - in debug mode works fine
  • according to eurekalog: EXCEPTION_STACK_OVERFLOW
  • probably in line:
    op.add_StateChanged(TCoreWebView2StateChangedEventHandler.Create(FWebBrowser, d.URI), @est); in VCL.TMSFNCWebBrowser.Win

Regards

Thank you for the detailed information.

We found the cause of the issue.
A fix with the incremental source update will be sent to you.

2 Likes