CommunityToolkit / Microsoft.Toolkit.Win32

ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.
https://aka.ms/windowsappsdk
Other
384 stars 89 forks source link

how to download files by using webview(edge) #145

Open ailianyiren opened 5 years ago

ailianyiren commented 5 years ago

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!

verelpode commented 5 years ago

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!

HEBERT8092 commented 4 years ago

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.