I'm trying to donwload an excel file already existing in my shiny app.
I've tried following code in server.R
output$downloadbutton <- downloadHandler(
filename <- function() {
paste("result_balance", "xlsx", sep=".")
},
content <- function(file) {
#temp <- file.path(tempdir(), "report.Rmd")
file.copy(file.path(getwd(),'www','result.xlsx'), file,overwrite = TRUE)
},
contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
but when user click on Download button it appears a download pop up like this:
and it will download a folder with xml/html files in it. Weird is that the proposed name is downloadbutton like my id shiny element.
I'm already aware of this R Shiny: Download existing file.
R version 3.6.2 on Ubuntu 18.04