Hello!
I have a Shiny app that works just fine when I try it on my laptop.
It has, among other things, an observeEvent that saves some outputs to reactiveValues 'main_reactive$europe' and 'main_reactive$shares'.
At the very end of server.r, right after my observeEvent block, I have this code:
# Ensuring the user can save (download) the resulting shares:
output$down_shares <- downloadHandler(
filename = function() {
paste0(input$downShares, ".csv")
},
content = function(file) {
if (main_reactive$europe == 1) {
df_shares <- main_reactive$shares
write.csv2(df_shares, file, row.names = FALSE)
} else {
df_shares <- main_reactive$shares
write.csv(df_shares, file, row.names = FALSE)
}
}
)
The user can save the results of my observeEvent calculations using this downloadHandler - based on the string s/he provided in input$downShares. And it works on my laptop. But when I run it on RStudiopro server, the download handler is not working - it just shows a string 'down_shares' - and it's not a .csv file ("Save as type" = all files). And when I save it - it's just an empty file without any extension.
I am at my wit's ends. Any idea why this might be happening?
Thank you so much!