Asset Download

Download full text

Download a work artifact by version, choosing the format, disposition, local save path, and redirect behavior. The response schema is the same returned by the download endpoint here.

const file = await client.works.download(
    "work-id-example", // required; Dryad work identifier
    "v1", // required; version identifier or label to download
    {
      kind: "raw", // optional; artifact flavor ("raw"|"minxml"|"plain")
      disposition: "attachment", // optional; request Content-Disposition ("inline"|"attachment")
      saveTo: "/tmp/work-v1.zip", // optional; local file path to persist the download
      followRedirect: true, // optional; follow 30x redirects to presigned URLs (default true)
    }
  );

Last updated