downloadAttachment: Download Attachment

View source: R/downloadAttachment.R

downloadAttachmentR Documentation

Download Attachment

Description

Downloads an attachment and returns it as a binary blob or saves it to disk.

Usage

downloadAttachment(
  experimentId,
  attachmentId,
  destination = NULL,
  overwrite = FALSE
)

Arguments

experimentId

ID of the experiment.

attachmentId

ID of the attachment.

destination

Optional. If specified, write the file to the specified path instead of returning it as a binary blob.

overwrite

Optional. If a destination is specified, allows destination file to be overwritten.

Examples

## Not run: 
# Returns the attachment as a binary blob:
attachment <- downloadAttachment(experimentId, attachmentId)
# Parse it as text:
readBin(attachment, character())

# Saves the attachment to disk:
downloadAttachment(experimentId, attachmentId, destination = "dir/file.txt")

# Use the byName helper to avoid finding the attachment ID:
downloadAttachment(experimentId, byName("file.txt"))

## End(Not run)

primitybio/cellengine-r-toolkit documentation built on Oct. 19, 2024, 1:17 a.m.