Microsoft.Toolkit.Win32 icon indicating copy to clipboard operation
Microsoft.Toolkit.Win32 copied to clipboard

how to download files by using webview(edge)

Open ailianyiren opened this issue 6 years ago • 2 comments

I cannot download files using webview(edge) components in WinForm or UserControl. Is there no download function?

I use webview(edge) to display the web page in WinForm or UserControl, and the web page contains the button to download the file. It is normal to download the file in ie or Chrome browser, but when I click on the webview, there is no response.I didn't find a description of webview(edge) download in the Microsoft documentation. I want the EDGE browser to pop up when the webview is downloaded in WinForm. If possible, please give me an example,thinks!

ailianyiren avatar Jul 18 '19 05:07 ailianyiren

The issue of temporary/session cookies complicates the file download issue. On one hand, it can be said that you can download the files by using Windows.Web.Http.HttpClient or System.Net.Http.HttpClient in conjunction with WebView.UnviewableContentIdentified, but unfortunately this answer isn't 100% true because it only works if the website does not require a temporary/session cookie. When WebView runs in a separate process, the temporary cookies in the separate process are unavailable to the app using WebView. I wish WPF WebView had a solution for this problem!

verelpode avatar Aug 17 '19 03:08 verelpode

Hello, I have the same problem. But I thought than it was a problem of permission. If I understand well, there don't have a real solution with a WebView ? With a WebBrowser tha works well.

HEBERT8092 avatar Oct 14 '19 13:10 HEBERT8092