Hi. I'm SHINY beginner.
I want to enable a user to download a csv file using my shiny app in a web browser.
So I searched and found the method below and first I created a simple app for testing.
I uploaded my app to the Ubuntu server and tested the app in a web browser.(Windows 10 PC)
ui <- fluidPage(
downloadButton("Download", "Download")
)
server <- function(input, output){
output$Download <- downloadHandler(
filename = function() {
paste("dataset-", Sys.Date(), ".csv", sep="")
},
content = function(file){
temp <- setwd(tempdir())
on.exit(setwd(temp))
write.csv(mtcars, file)
}
)
}
This feature works fine in the IDE.
However, when running this test app in a web browser, the csv file was downloaded only to the Download folder. (C: \ Users \ Name \ Downloads)
I would like to know how to download to the directory specified by the user.
If possible, please let me know by example and thank you in advance