Try and download a file.

download.url(url, file, timeout = 600, .opts = list(),
  retry404 = TRUE)

Arguments

url

the url of the file to download

file

the filename

timeout

number of seconds to wait for file (default 600)

.opts

list of options for curl, for example to download from a protected site use list(userpwd=userpass, httpauth = 1L)

retry404

retry on a 404, this is used by Brown Dog

Value

returns name of file if successful or NA if not.

Details

This will download a file, if retry404 and 404 is returned it will wait until the file is available. If the file is still not available after timeout tries, it will return NA. If the file is downloaded it will return the name of the file

Examples

# NOT RUN {
download.url('http://localhost/', index.html)
# }