Skip to contents

A zip published on ReShare is often mostly material a reader does not need: stimuli, images, or videos alongside the few data files. ReShare's per-file download URLs support byte-range requests 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/Figshare/Dryad path).

Usage

.reshare_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, matching zip_decision()

max_file_size

largest member to extract (in MB), applied per member exactly as the deposit-level cap is applied per file

size

the zip's size in bytes as the listing gives it, or NULL. Passed on to zip_peek() so it does not have to send a HEAD request to learn a size the listing already gave.

Value

a data frame with one row per extracted member (name, path, size, ok), or NULL when the archive could not be listed and the caller should download it whole instead