download_ftp_file: Function to download files from an 'FTP' or 'SFTP' server.

View source: R/download_ftp_file.R

download_ftp_fileR Documentation

Function to download files from an FTP or SFTP server.

Description

Function to download files from an FTP or SFTP server.

Usage

download_ftp_file(
  file_remote,
  file_local,
  credentials = "",
  curl = FALSE,
  sleep = NA,
  verbose = FALSE
)

Arguments

file_remote

URLs of the files to be downloaded.

file_local

File names for the local version of file_remote. download_ftp_file will create directories if they do not exist and are used.

credentials

Credentials for a FTP or SFTP server. Do not use credentials if the server does not require authentication. credentials takes the format: "username:password".

curl

Should RCurl be used to download the files or base R's download.file? If credentials are used, RCurl will always be used.

sleep

Number of seconds to wait between querying server.

verbose

Should the function give messages about download progress?

Author(s)

Stuart K. Grange

See Also

list_files_ftp, upload_to_ftp

Examples


## Not run: 
# Download a file from a server which does not need credentials
url <- "ftp://ftp.ncdc.noaa.gov/pub/data/noaa/isd-history.csv"
download_ftp_file(url, "~/Desktop/noaa_data.csv", verbose = TRUE)

## End(Not run)


skgrange/threadr documentation built on April 15, 2024, 9:35 p.m.