% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fetch.R
\name{fetch_file}
\alias{fetch_file}
\title{Download a file from RAP project storage}
\usage{
fetch_file(path, dest_dir, overwrite = FALSE, resume = FALSE, verbose = TRUE)
}
\arguments{
\item{path}{(character) Remote file or folder path.}

\item{dest_dir}{(character) Destination directory. Created automatically
if it does not exist.}

\item{overwrite}{(logical) Overwrite existing local files. Default:
\code{FALSE}.}

\item{resume}{(logical) Resume an interrupted download. Useful for large
files (e.g. \code{.bed}, \code{.bgen}). Default: \code{FALSE}.}

\item{verbose}{(logical) Show download progress. Default: \code{TRUE}.}
}
\value{
Invisibly returns the local file path(s) as a character vector.
}
\description{
Downloads one file or all files within a folder from RAP project storage
to the current directory or a specified destination within the RAP
environment. This function must be called from within RAP.
}
\examples{
\dontrun{
# Download a single metadata file
fetch_file("Showcase metadata/field.tsv", dest_dir = "data/")

# Download an entire folder
fetch_file("Showcase metadata/", dest_dir = "data/metadata/")

# Resume an interrupted download
fetch_file("results/summary_stats.csv", dest_dir = "data/", resume = TRUE)
}
}
