
Fetch selected files out of a .zip in a Figshare article without downloading it
Source:R/archive-figshare.R
dot-figshare_zip_members.RdA zip published on Figshare is often mostly material a reader does not
need: stimuli, images, or videos alongside the few data files. Figshare
serves its per-file download URLs with byte-range support and every member
of a zip is compressed on its own, so individual members can be pulled out
of the archive while the rest is never transferred (see
.zip_member_fetch(), shared with the identical Zenodo/Dataverse path).
Usage
.figshare_zip_members(
url,
dest,
keep_types = c("data", "documentation"),
max_file_size = 10,
size = NULL
)Arguments
- url
the file's
download_url- dest
directory to write the extracted members into
- keep_types
file categories worth extracting, as
data_classify_files()names them; the default keeps data and documentation and skips materials, matchingzip_decision()- max_file_size
largest member to extract (in MB), applied per member exactly as the article-level cap is applied per file
- size
the zip's size in bytes as the article lists it, or
NULL. Passed on tozip_peek(), which otherwise sends aHEADrequest to learn it – and a Figsharedownload_urlredirects to a signed Amazon S3 address that answersHEADwith 403 (verified 2026-10-13 on file 51618395), so without the size every peek began with a request that could only fail.