Learn R Programming

connector (version 0.1.0)

upload_cnt: Upload content to the connector

Description

Generic implementing of how to upload files to a connector:

Usage

upload_cnt(
  connector_object,
  file,
  name = basename(file),
  overwrite = zephyr::get_option("overwrite", "connector"),
  ...
)

# S3 method for ConnectorFS upload_cnt( connector_object, file, name = basename(file), overwrite = zephyr::get_option("overwrite", "connector"), ... )

Value

invisible connector_object.

Arguments

connector_object

Connector The connector object to use.

file

character Path to the file to download to or upload from

name

character Name of the content to read, write, or remove. Typically the table name.

overwrite

Overwrite existing content if it exists in the connector?. Default: FALSE.

...

Additional arguments passed to the method for the individual connector.

Examples

Run this code
# Upload file to a file storage

writeLines("this is an example", "example.txt")

folder <- withr::local_tempdir()
cnt <- connector_fs(folder)

cnt |>
  list_content_cnt(pattern = "example.txt")

cnt |>
  upload_cnt("example.txt")

cnt |>
  list_content_cnt(pattern = "example.txt")

cnt |>
  remove_cnt("example.txt")

file.remove("example.txt")

Run the code above in your browser using DataLab