% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/s3.R
\name{dse_s3_download}
\alias{dse_s3_download}
\title{Download Asset Through Uniform Resource Identifier}
\usage{
dse_s3_download(
  uri,
  destination,
  ...,
  s3_key = dse_s3_get_key(),
  s3_secret = dse_s3_get_secret()
)
}
\arguments{
\item{uri}{A Uniform Resource Identifier (URI, starting with "s3://").
You can look for them in the STAC catalogue, either using a
\href{https://browser.stac.dataspace.copernicus.eu/}{web browser} or
\code{\link[=dse_stac_search_request]{dse_stac_search_request()}} (see example).}

\item{destination}{Destination path to a directory where to store the downloaded file(s)}

\item{...}{Ignored}

\item{s3_key, s3_secret}{The s3 key and secret registered under your Data Space
Ecosystem account}
}
\value{
A vector of file names stored at \code{destination}
}
\description{
When the Uniform Resource Identifier (URI, starting with "s3://") for
an asset is known, this function can be used to download it
}
\examples{
if (interactive() && dse_has_s3_secret()) {
  library(dplyr)

  ## Retrieve a URI for a specific asset through the STAC
  ## catalogue:   
  my_uri <-
    dse_stac_search_request(
      ids = "S2A_MSIL1C_20260109T132741_N0511_R024_T39XVL_20260109T142148") |>
        select("assets.B01.href") |>
        arrange("id") |>
        collect() |>
        pull("assets") |>
        unlist()
  
  dse_s3_download(my_uri, tempdir())

}
}
\seealso{
Other s3:
\code{\link[=dse_has_s3_secret]{dse_has_s3_secret()}},
\code{\link[=dse_s3_set_gdal_options]{dse_s3_set_gdal_options()}},
\code{\link[=dse_s3_uri_to_vsi]{dse_s3_uri_to_vsi()}}
}
\concept{s3}
