DotNetBrowser  1.14
Public Member Functions | List of all members
DotNetBrowser.DownloadHandler Interface Reference

Allows handling file downloads. More...

Inherited by DotNetBrowser.DefaultDownloadHandler.

Public Member Functions

bool AllowDownload (DownloadItem downloadItem)
 This method is invoked when Browser is going to download a file. The download parameter contains all information about the the file which is going to be downloaded. More...
 

Detailed Description

Allows handling file downloads.

When Browser instance cannot display a specified file (e.g. ///.zip file) the DownloadHandler.AllowDownload(DownloadItem)} method will be used to check whether this file can be downloaded. If this method returns TRUE, the file download is started.

You can use this handler to suppress all file downloads or download only files with a specific mime type.

Member Function Documentation

bool DotNetBrowser.DownloadHandler.AllowDownload ( DownloadItem  downloadItem)

This method is invoked when Browser is going to download a file. The download parameter contains all information about the the file which is going to be downloaded.

To suppress file download, this method must return FALSE.

By default the file will be downloaded into application's working directory. You can get or set the absolute file path using the DownloadItem.DestinationFile property.

Parameters
downloadIteminformation about the file that will be downloaded.
Returns
TRUE to allow downloading the file or FALSE to suppress it.

Implemented in DotNetBrowser.WinForms.WinFormsDefaultDownloadHandler, DotNetBrowser.WPF.WPFDefaultDownloadHandler, and DotNetBrowser.DefaultDownloadHandler.