Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gcs_signed_url

Create a signed URL


Description

This creates a signed URL which you can share with others who may or may not have a Google account. The object will be available until the specified timestamp.

Usage

gcs_signed_url(
  meta_obj,
  expiration_ts = Sys.time() + 3600,
  verb = "GET",
  md5hash = NULL,
  includeContentType = FALSE
)

Arguments

meta_obj

A meta object from gcs_get_object

expiration_ts

A timestamp of class "POSIXct" such as from Sys.time() or a numeric in seconds from Unix Epoch. Default is 60 mins.

verb

The URL verb of access e.g. GET or PUT. Default GET

md5hash

An optional md5 digest value

includeContentType

For getting the URL via browsers this should be set to FALSE (the default). Otherwise, set to TRUE to include the content type of the object in the request needed.

Details

Create a URL with a time-limited read and write to an object, regardless whether they have a Google account

See Also

Other download functions: gcs_download_url(), gcs_parse_download()

Examples

## Not run: 

obj <- gcs_get_object("your_file", meta = TRUE)

signed <- gcs_signed_url(obj)

temp <- tempfile()
on.exit(unlink(temp))

download.file(signed, destfile = temp)
file.exists(temp)


## End(Not run)

googleCloudStorageR

Interface with Google Cloud Storage API

v0.6.0
MIT + file LICENSE
Authors
Mark Edmondson [aut, cre] (<https://orcid.org/0000-0002-8434-3881>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.