fail to donwlaod zip file from WB using downlaod.file

I am trying to download zip file (64.5 MB) from WB, but never completes downloading
trying URL 'https://databank.worldbank.org/data/download/WDI_csv.zip'
Content type 'application/x-zip-compressed' length 67669068 bytes (64.5 MB)
downloaded 8.1 MB

utils::download.file("https://databank.worldbank.org/data/download/WDI_csv.zip",   "WB_WDI.zip", mode = "wb")

Hi there,

I would recommend something like the below. You will see here is some good commentary on how you should work with downloading like this:

Try something like this. Take note you will have to up the timeout value as this download might take a significant amount of time depending on how quickly you can download it and the transfer rate they provide.

temp <- tempfile()
download.file("https://databank.worldbank.org/data/download/WDI_csv.zip",temp,
             timeout = max(300, getOption("timeout")))

Another good option to look at is: CRAN - Package downloader

downloading get broken/stopped at 13%

If I try and download that .zip normally through my browser it seems to timeout. So that might be a problem on their end. I would look for a more reliable end point to download as the functions and code above is robust.

The zip downloads fail for most users due to the unintuitive nature of the download steps .

I do not understand what you said! i am sorry

Dear @melgoussi,
Zip files may refuse to open if they are not properly downloaded. Also, incomplete downloads occur when files get stuck due to issues like bad internet connection, inconsistency in network connection, all of which can cause transfer errors, affect your Zip files and make them unable to open.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.