upload_cnt {connector} | R Documentation |
Upload content to the connector
Description
Generic implementing of how to upload files to a connector:
-
ConnectorFS: Uses
fs::file_copy()
to copy thefile
to the file storage.
Usage
upload_cnt(
connector_object,
file,
name = basename(file),
overwrite = zephyr::get_option("overwrite", "connector"),
...
)
## S3 method for class 'ConnectorFS'
upload_cnt(
connector_object,
file,
name = basename(file),
overwrite = zephyr::get_option("overwrite", "connector"),
...
)
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: |
... |
Additional arguments passed to the method for the individual connector. |
Value
invisible connector_object.
Examples
# 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")
[Package connector version 0.1.1 Index]