Skip to contents

Domain-specific upload functions for the four platform buckets. Each enforces UUID validation, constructs the canonical key path, and delegates to cdn_upload() / cdn_upload_dir().

Usage

write_art_coa(artist, artwork, local_path, delete_local = FALSE)

write_art_public(artist, artwork = NULL, local_path, delete_local = FALSE)

write_art_data(
  artist,
  artwork,
  local_path,
  prefix = NULL,
  delete_local = FALSE
)

write_art_vault(
  artist,
  artwork,
  local_path,
  prefix = NULL,
  delete_local = FALSE
)

Arguments

artist

Character(1). UUID of the artist.

artwork

Character(1). UUID of the artwork (required where noted).

local_path

Character(1). Path to a local file or directory.

delete_local

Logical(1). Delete the local file after a verified upload. Defaults to FALSE.

prefix

Character(1). S3 prefix (for art-data / art-vault).

Value

Invisibly, a character vector of S3 key(s) uploaded.

Functions

  • write_art_coa(): Upload a certificate to art-coa

    Writes a single certificate file (PDF or JPEG) to art-coa at issued/{artist}/{artwork}/.

  • write_art_public(): Upload a thumbnail to art-public

    Writes artist or artwork thumbnails to art-public at thumbnails/artist/{artist}.{ext} or thumbnails/{artist}/{artwork}.{ext}.

  • write_art_data(): Upload processed assets to art-data

    Uploads a directory (or single file) into art-data at processed/{artist}/{artwork}/.

  • write_art_vault(): Upload original bundle to art-vault

    Uploads a directory (or single file) into art-vault at uploads/{artist}/{artwork}/.

Examples

if (FALSE) { # \dontrun{
tmp <- tempfile(fileext = ".pdf")
writeLines("demo", tmp)
write_art_coa(
  "11111111-1111-1111-1111-111111111111",
  "22222222-2222-2222-2222-222222222222",
  tmp
)
} # }
if (FALSE) { # \dontrun{
thumb <- tempfile(fileext = ".jpeg")
writeLines("jpeg-data", thumb)
write_art_public("abcd1234-abcd-1234-abcd-abcd12341234", local_path = thumb)
} # }
if (FALSE) { # \dontrun{
f <- tempfile(fileext = ".txt")
cat("hello", file = f)
write_art_data(
  "11111111-1111-1111-1111-111111111111",
  "22222222-2222-2222-2222-222222222222",
  local_path = f
)
} # }
if (FALSE) { # \dontrun{
dir_tmp <- fs::dir_create(tmp <- tempfile("vault_"))
writeLines("canvas", file.path(tmp, "canvas.procreate"))
write_art_vault("11111111-1111-1111-1111-111111111111",
                "22222222-2222-2222-2222-222222222222", tmp)
} # }