Polite file download

rip(
  bow,
  destfile = NULL,
  ...,
  mode = "wb",
  path = tempdir(),
  overwrite = FALSE
)

Arguments

bow

host introduction object of class polite, session created by bow() or nod()

destfile

optional new file name to use when saving the file. If missing, it will be guessed from `basename(url)``

...

other parameters passed to download.file

mode

character. The mode with which to write the file. Useful values are w, wb (binary), a (append) and ab. Not used for methods wget and curl.

path

character. Path where to save the destfile. By default is temporary directory created with tempdir() Ignored if destfile contains path along with filename.

overwrite

if TRUE will overwrite file on disk

Value

Full path to the locally saved file indicated by the user in destfile (and path)

Examples

# \donttest{ bow("https://www.cheese.com/") %>% nod("media/img/sub-page-slide2.jpg") %>% rip()
#> [1] "/tmp/RtmpByiryW/sub-page-slide2.jpg"
# }