File: b64EncodeFile.R

package info (click to toggle)
r-cran-markdown 1.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 552 kB
  • sloc: ansic: 4,618; sh: 32; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
library(markdown)

## Download
url = "https://www.r-project.org/Rlogo.png"
path = tempdir()
pathname = file.path(tempdir(), basename(url))
if (!file_test("-f", pathname)) try(download.file(url, pathname))

if (file.exists(pathname)) {
  ## Encode
  data = markdown:::.b64EncodeFile(pathname)
  str(data)

  unlink(pathname)
}