Skip to contents

Download File from the Internet

Usage

download(
  url,
  destfile,
  methods = c("auto", "wget", "libcurl", "curl", "wininet", "internal"),
  max_tries = 2,
  use_httr = FALSE,
  verbose = TRUE,
  ...
)

Arguments

url

a character string (or longer vector for the "libcurl" method) naming the URL of a resource to be downloaded.

destfile

a character string (or vector, see the url argument) with the file path where the downloaded file is to be saved. Tilde-expansion is performed.

methods

Methods to be used for downloading files. The default is to try different download methods in turn until the download is successfully completed.

max_tries

Number of tries for each download method.

use_httr

Logical value, default is FALSE. Whether to use httr2::request to download the file.

verbose

Logical value, default is TRUE. Whether to print progress messages.

...

Other arguments passed to utils::download.file