点击下载按钮后,是否可以检测用户下载文件的时间?我试过这个但是observeEvent不能用于输出?:
observeEvent(output$downloadData2, {})
下载处理程序示例:
ui.r:
downloadButton("downloadData2", "Download results")
server.r:
output$downloadData2 <- downloadHandler(
filename <- function() {
paste("results.zip")
},
content <- function(file) {
workingdir = getwd()
setwd("tmp/")
file.copy(paste(direc,'.zip',sep=''), file)
setwd(workingdir)
},
contentType = "application/zip"
)