deleteFile = FALSE in renderImage not working

r, shiny

Solution

Try:

library(shiny)

shinyServer(function(input, output,session) {

   output$f1 <- renderImage({
      list(src="f1.png")
   }, deleteFile = FALSE) 
})

Problem

I have a problem with the deleteFile = FALSE argument of renderImage. In short it deletes the image file anyway. As a short test example i have the ui.R ``` library(shiny) shinyUI(fluidPage( titlePanel("Testing ..."), sidebarLayout( sidebarPanel(), mainPanel( imageOutput("f1") ) ) )) ``` and the server.R ``` library(shiny) shinyServer(function(input, output,session) { output$f1 <- renderImage({ list(src="f1.png", deleteFile = FALSE) }) }) ``` where f1.png is some png image file. When i run this it displays the image ok, but also deletes it from the folder, exactly what deleteFile = FALSE is supposed to not do. I am on a Win7 machine, in case that matters. Wolfgang Added: I now found another way to do this, using ``` output$f1 <- renderText({ HTML("<img src=\"f1.png\">") }) ``` and uiOutput in ui.R, and this works fine, but the original question remains, why does shiny delete the image files despite the deleteFile=FALSE argument? Wolfgang

Original source