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

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

if (FALSE) { # \dontrun{
# 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"))
} # }