Skip to content

Streams the object to disk. It is written next to its final name with the suffix .s3pe-part and renamed when complete and verified, so an interrupted download leaves nothing at path.

Usage

download_s3(key, path, bucket = NULL, overwrite = FALSE, config = s3_config())

Arguments

key

Object key inside bucket, or an s3://bucket/key URL.

path

Where to write. Its directory is created if needed.

bucket

Bucket; defaults to the config's bucket (S3PE_BUCKET).

overwrite

Replace path if it exists?

config

An s3_config().

Value

Invisibly, a one-row tibble: bucket, key, size, etag, elapsed.

Examples

if (FALSE) { # interactive()
download_s3("data/regions.geojson", "regions.geojson", bucket = "my-bucket")
}