Skip to content

A URL anyone can use for expires seconds, without credentials, to read (GET) or write (PUT) the object. The signature is in the query string (AWS Signature Version 4).

Usage

presign_s3(
  key,
  bucket = NULL,
  expires = 3600,
  method = c("GET", "PUT"),
  config = s3_config()
)

Arguments

key

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

bucket

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

expires

Validity in seconds, from 1 to 604800 (seven days).

method

"GET" to share a download, "PUT" to accept an upload.

config

An s3_config().

Value

The URL, a string.

Examples

if (FALSE) { # interactive()
presign_s3("report/report.pdf", bucket = "my-bucket", expires = 3600)
}