Rstudio cannot find image in www folder

I have this code from a previous working example:

page_name="logo"
shinyUI(
  pageWithSidebar(

    headerPanel('Sortable list'),
    sidebarPanel(
      tags$head(tags$script(src = "js/jquery-ui.min.js")),
      wellPanel(
        uiOutput('sortable_rui')
      ),
      wellPanel(
        uiOutput('sortable2_rui')
                ),
      wellPanel(
                h5(page_name),
                img(src=paste0(page_name,".png")),
                img(src=paste0("www/",page_name,".png"))
                )
    ),

    mainPanel(
      tableOutput('showData'),
      verbatimTextOutput('showorder'),
      tableOutput('showData2'),
      verbatimTextOutput('showorder2')
    )
  )
)

And here is what I have inside the folder www/:

avilella@ubuntu64:/var/shiny-server/www/sortable/www$ ls -l
total 76
drwxrwxr-x 2 avilella avilella  4096 Jan 30 09:26 js
-rwxrwx--- 1 avilella avilella 67022 Feb 10 14:47 logo.png
-rw-rw-r-- 1 avilella avilella   299 Jan 30 09:26 sort.css

However, it does not find the logo inside www/:

enter image description here

Any ideas?

+3
source share
1 answer

Your code is in order, because permission to the logo.png file does not allow ordinary users to see it. Try chmod 664 / var / shiny-server / www / sortable / www / logo.png from the command line

You do not need to specify www / here, so the following works:

img(src=paste0(page_name,".png")),
+2
source

All Articles