10
光っているアプリ(サーバー上にある)に既存のzipファイル(out.zip
)があるとします。ユーザーにこのファイルをダウンロードさせたいと思います。この質問はthis oneと非常によく似ています。しかし、その質問はdownloadHandler
内のファイルを圧縮しますが、zipファイルはすでに私のケースに存在します。R Shiny:既存のファイルをダウンロード
library(shiny)
app <- list(
ui = fluidPage(
titlePanel(""),
sidebarLayout(
sidebarPanel(
downloadButton("downloadData", label = "Download")
),
mainPanel(h6("Sample download", align = "center"))
)
),
server = function(input, output) {
output$downloadData <- downloadHandler(
filename <- function() {
paste("output", "zip", sep=".")
},
content <- function(file) {
# not sure what to put here???
},
contentType = "application/zip"
)
}
)
shiny::runApp(app)