Download link in Rmarkdown website

Hello!
Is it possible to add a a link to download a file directly from a url? I'm doing a basic website with rmarkdown and I tried to use downloadthis but it doesn't seem to work.
This is the chunk

library(downloadthis)
## Link in Github repo
download_link(
  link = "https://raw.githubusercontent.com/aescocasti/Charta-Teitok/main/2021-10-07_cosuiza_header_comentado.xml",
  button_label = "Download file",
  button_type = "danger",
  has_icon = TRUE,
  icon = "fa fa-save",
  self_contained = FALSE
)

I think it is possible but you need to use a download url. In the example, it is github raw content and the url will open the raw file in the browser when it is text, not trigger a download. So clicking on the button will open the raw file in the browser.

Thanks, I figured it out. Not the best way though. I used a tool called DownGit. Not sure how to do a download url on github.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.