View source: R/cloud-storage.R
upload_cloud_file | R Documentation |
Upload a local file to a cloud storage bucket
upload_cloud_file(file, provider, options, name = file)
file |
a file-path (character) to upload. A vector with multiple files is also supported. |
provider |
cloud provider to use, either "gcs" or "aws" |
options |
named list with cloud provider options, see details |
name |
What to call the file once uploaded. Default is the filepath |
For Google Cloud Services ("gcs") options must be a list with two fields:
bucket
with the bucketname (character) you are uploading to, and
service_account_key
with the contents of the authentication json file you
have downloaded from your Google Project (if cloud_storage_authenticate has
not been called before).
This function uses googleCloudStorageR::gcs_upload under the hood to upload the file.
If provider
is "gcs" and if successful a list of medatada objects
# Google Cloud Services
## Not run:
authentication_details <- readLines("location_of_json_file.json")
upload_cloud_file(
file = "table_to_upload.csv",
provider = "gcs",
options = list(
service_account_key = authentication_details,
bucket = "my-bucket"
)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.