title: display png file in shinyR
body: <p>I am trying to display a png file using shiny. file is uploaded but not displayed properly. I have included both ui and server code</p>
  
  <pre><code>ui &lt;- fluidPage(
    titlePanel("Upload Slide Image"),
    sidebarLayout(
      sidebarPanel(fileInput("file1", "Choose png File", multiple = TRUE, 
    accept = c(".png")) ), # Input: Select a file ----
      mainPanel(imageOutput("myImage")) 
    )
  )
  
  server &lt;- function(input, output, session){
    output$myImage &lt;- renderImage({
      outfile &lt;- tempfile(fileext = '.png')
      png(outfile, width = 400, height = 300) # Generate the PNG
      dev.off()
      list(src = outfile,contentType = 'image/png',width = 400, height = 300,
           alt = "This is alternate text")
    }, deleteFile = TRUE)
  }
  
  # Create Shiny app ----
  shinyApp(ui, server)
  </code></pre>