The building block behind as.img() and
as.fileLink(): reads a file and returns its contents
base64-encoded, ready to be placed in a data URI or in any container
format that carries binary payloads as text.
See also
Other html:
as.fileLink(),
as.html(),
as.img(),
escapeHtml(),
htmlNotation,
htmlSubscript,
toHtmlTable()
Examples
fn <- tempfile(fileext = ".txt")
writeLines("hello", fn)
substr(embedFile(fn), 1, 8)
#> [1] "aGVsbG8K"
unlink(fn)
