0

When I use the download.file function with method curl I get a downloaded file with 0 bytes.

for example:

download.file('https://github.com/rstudio/rmarkdown/archive/refs/heads/main.zip', destfile='library', method='curl')

Produces the following output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
character(0)

How can I get this fixed?

Note: method='wget' works but that is because my Mac has wget, however my windows laptop only has curl as an option, and this does not work. I specifically want to fix the curl method.

Working dollar
  • 306
  • 2
  • 10
  • See https://stackoverflow.com/questions/23028760/download-a-file-from-https-using-download-file – br00t Oct 21 '22 at 16:07
  • 1
    @br00t I have seen this and it did not help. Everyone provided only alternatives to `method='curl'` rather than providing a solution with its use. – Working dollar Oct 21 '22 at 16:27
  • Which version of Windows are you running @Working dollar? As of Windows 10 `curl` is bundled with the OS so no need to install any binaries. Earlier version may require you to download a `curl` binary and put the binary into your `PATH` variable. See also: https://stackoverflow.com/questions/9507353/how-do-i-install-and-use-curl-on-windows – br00t Oct 21 '22 at 16:40

0 Answers0