Download large files with R and RCurl
First, read documentation. Try with
#getCurlOptionTypes(opts = getCurlOptionsConstants())
#print (getCurlOptionTypes)
#listCurlOptions()
#getCurlOptionsConstants()
#getCurlOptionTypes(opts = getCurlOptionsConstants())
Then, this is the code ( pretty self explanatory)
downloadFile <-function(url, file){
curl = getCurlHandle()
curlSetOpt( .opts = list(http.version =HTTP_VERSION_1_0, verbose = TRUE),
curl = curl)
f = CFILE(file, mode=”wb”)
a = curlPerform(url = url,curl=curl, writedata = f@ref, noprogress=FALSE)
close(f)
}
Leave a Reply