title: downloading png/pdf plots while using shiny eventreactive
body: <p>I have been trying to download the plotout while using eventReactive in R shiny.
  Below is the example code </p>
  
  <pre><code>library(shiny)
  
  server &lt;- function(input, output) {
  
    getplot = eventReactive(input$plot,{
  
  
  
  plot(iris[,1])
    })
    output$plot = renderPlot({
     getplot()
    })
    output$downloadplot &lt;- downloadHandler(filename ="test.png",
                                           content = function(file) {
                                             png(file)
                                           getplot()
                                             dev.off()
                                           },
                                           contentType = "image/png")
  }
  
  ui &lt;- fluidPage(
    actionButton("plot","test plot"),
    plotOutput("plot"),
    downloadButton("downloadplot", label = "Save png")
  
  )
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>Can any one help what must be changed inorder to successfuly download the file? ( currently it says file not found)
  p.s: I have tried using thecouter as mentioned in this <a href="https://stackoverflow.com/questions/39116301/r-shiny-eventreactive-actionbotton-interaction">R Shiny eventReactive actionBotton interaction</a> still no success</p>