aws_bucket_upload | R Documentation |
Upload a folder of files to create an S3 bucket
aws_bucket_upload(
path,
bucket,
max_batch = fs::fs_bytes("100MB"),
force = FALSE,
...
)
path |
(character) local path to a directory. required |
bucket |
(character) bucket name. required |
max_batch |
(fs_bytes) maximum batch size being uploaded with each multipart |
force |
(logical) force deletion without going through the prompt.
default: |
... |
named parameters passed on to |
To upload individual files see aws_file_upload()
the s3 format path of the bucket uploaded to
Requires the env var AWS_REGION
. This function prompts you to make
sure that you want to delete the bucket.
Other buckets:
aws_bucket_create()
,
aws_bucket_delete()
,
aws_bucket_download()
,
aws_bucket_exists()
,
aws_bucket_list_objects()
,
aws_bucket_tree()
,
aws_buckets()
,
six_bucket_delete()
,
six_bucket_upload()
library(fs)
tdir <- path(tempdir(), "apples")
dir.create(tdir)
tfiles <- replicate(n = 10, file_temp(tmp_dir = tdir, ext = ".txt"))
invisible(lapply(tfiles, function(x) write.csv(mtcars, x)))
bucket_name <- random_bucket()
if (!aws_bucket_exists(bucket_name)) aws_bucket_create(bucket_name)
aws_bucket_upload(path = tdir, bucket = bucket_name)
aws_bucket_list_objects(bucket_name)
# cleanup
objs <- aws_bucket_list_objects(bucket_name)
aws_file_delete(objs$uri)
aws_bucket_list_objects(bucket_name)
aws_bucket_delete(bucket_name, force = TRUE)
aws_bucket_exists(bucket_name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.