IFileDownloader.DownloadFile Method
Declaring Type: IFileDownloader
Namespace: Velopack.Sources
Assembly: Velopack
Assembly Version: 0.0.1049+da27736
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, 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.
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.
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