Skip to main content

IFileDownloader.DownloadFile Method

Declaring Type: IFileDownloader
Namespace: Velopack.Sources
Assembly: Velopack
Assembly Version: 0.0.942+a011233

Downloads a remote file to the specified local path

public Task DownloadFile(string url, string targetFile, Action<int> progress, string authorization = null, string accept = null, CancellationToken cancelToken = default);

Parameters

url string

The url which will be downloaded.

targetFile string

The local path where the file will be stored If a file exists at this path, it will be overwritten.

progress Action<int>

A delegate for reporting download progress, with expected values from 0-100.

authorization string

Text to be sent in the 'Authorization' header of the request.

accept string

Text to be sent in the 'Accept' header of the request.

cancelToken CancellationToken

Optional token to cancel the request.

Returns

Task


Documentation generated by MdDocs