Partilhar via


CoreWebView2DownloadOperation Class

Definition

Represents a download operation. Gives access to a download's metadata and supports a user canceling, pausing, or resuming a download.

public class CoreWebView2DownloadOperation
type CoreWebView2DownloadOperation = class
Public Class CoreWebView2DownloadOperation
Inheritance
CoreWebView2DownloadOperation

Properties

BytesReceived

The number of bytes that have been written to the download file.

CanResume

Returns true if an interrupted download can be resumed. Downloads with the following interrupt reasons may automatically resume without you calling any methods: @CoreWebView2DownloadInterruptReason$.ServerNoRange, @CoreWebView2DownloadInterruptReason$.FileHashMismatch, @CoreWebView2DownloadInterruptReason$.FileTooShort. In these cases progress may be restarted with @CoreWebView2DownloadOperation.BytesReceived set to 0.

ContentDisposition

The Content-Disposition header value from the download's HTTP response. If none, the value is an empty string.

EstimatedEndTime

The estimated end time of the download.

InterruptReason

The reason why connection with file host was broken.

MimeType

MIME type of the downloaded content.

ResultFilePath

The absolute path to the download file, including file name.

State

The state of the download. A download can be in progress, interrupted, or completed.

TotalBytesToReceive

The total bytes to receive count.

Uri

The URI of the download.

Methods

Cancel()

Cancels the download.

Pause()

Pauses the download. If paused, the default download dialog shows that the download is paused. No effect if download is already paused. Pausing a download changes the state from in progress to interrupted, with interrupt reason set to @CoreWebView2DownloadInterruptReason$.UserCanceled.

Resume()

Resumes a paused download. May also resume a download that was interrupted for another reason if CanResume returns true.

Events

BytesReceivedChanged

Event raised when the bytes received count is updated.

EstimatedEndTimeChanged

Event raised when the estimated end time changes.

StateChanged

Event raised when the state of the download changes. Use @CoreWebView2DownloadOperation$.State to get the current state, and @CoreWebView2DownloadOperation$.InterruptReason to get the reason if the download is interrupted.

Applies to