downloadFile.character.Rd
Downloads a file.
# S3 method for character
downloadFile(url, filename=basename(url), path=NULL, skip=TRUE, overwrite=!skip, ...,
username=NULL, password=NULL, binary=TRUE, dropEmpty=TRUE, verbose=FALSE)
A character
string specifying the URL to be downloaded.
(optional) character
strings specifying the
local filename and the path of the downloaded file.
If TRUE
, an already downloaded file is skipped.
If TRUE
, an already downloaded file is overwritten,
otherwise an error is thrown.
Additional arguments passed to download.file
.
character
strings specifying the username
and password for authenticated downloads. The alternative is to
specify these via the URL.
If TRUE
, the file is downloaded exactly "as is", that is,
byte by byte (recommended).
If TRUE
and the downloaded file is empty, the file
is ignored and NULL
is returned.
Returns the local pathname to the downloaded filename,
or NULL
if no file was downloaded.
Currently arguments username
and password
are only used
for downloads via URL protocol 'https'. The 'https' protocol requires
that either of 'curl' or 'wget' are available on the system.
Internally download.file
is used.
That function may generate an empty file if the URL is not available.
if (FALSE) {
pathname <- downloadFile("https://www.r-project.org/index.html", path="www.r-project.org/")
print(pathname)
}