R Shiny在下载后检测并删除本地文件

时间:2016-05-15 17:56:07

标签: r shiny shiny-server

点击下载按钮后,是否可以检测用户下载文件的时间?我试过这个但是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"
)

0 个答案:

没有答案