Skip to main content

IFileDownloader.DownloadFile Method

Declaring Type: IFileDownloader
Namespace: Velopack.Sources
Assembly: Velopack
Assembly Version: 0.0.1298+ed8600e

Downloads a remote file to the specified local path

public Task DownloadFile(string url, string targetFile, Action<int> progress, [Nullable(Mono.Cecil.CustomAttributeArgument[])]IDictionary<string, string> headers = null, double timeout = 30, 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.

headers IDictionary<string, string>

Headers that can be passed to Http Downloader, e.g. Accept or Authorization.

timeout double

The maximum time in minutes to wait for the download to complete.

cancelToken CancellationToken

Optional token to cancel the request.

Returns

Task


Documentation generated by MdDocs