upload_to_ftp: Function to upload a files to an FTP or SFTP server.

View source: R/download_ftp_file.R

upload_to_ftpR Documentation

Function to upload a files to an FTP or SFTP server.

Description

upload_to_ftp will create directories if necessary.

Usage

upload_to_ftp(file, url, credentials = "", basename = FALSE, verbose = FALSE)

Arguments

file

File to upload.

url

The url of remote directory.

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".

basename

Should only the basename be used for transferring the files? This is useful when files to be uploaded are outside of the working directory, but the directory structure will be lost on the remote server.

verbose

Should the function give messages?

Author(s)

Stuart K. Grange

See Also

download_ftp_file, list_files_ftp

Examples

## Not run: 

# Get file list
file_list <- list.files(recursive = TRUE, full.names = TRUE)

# Exclude some files
file_list <- grep("cache|.Rmd$", file_list, value = TRUE, invert = TRUE)

# Upload files to server
upload_to_ftp(file_list, url, "user:pass")


## End(Not run)


skgrange/threadr documentation built on May 11, 2024, 12:16 p.m.