I have a shiny application in which I want to add the ability to select a folder. This application is used in the local network.

I tried:

 #UI library(shiny) shinyUI(fluidPage( actionButton("goButton","Choose folder"), textOutput("session")) ) #server library(shiny) shinyServer(function(input, output, session) { observe({ if(input$goButton > 0){ output$session <- renderText(function(){ list.files(choose.dir())}) } }) }) 

When I start from my PC, everything works fine, but when other users try to select a folder, a window for selection appears on my PC, not on them.

Is there a way to implement folder selection by other users?

Original question on SO

    1 answer 1

    Try the shinyFiles package. For an example, see:

     shinyFilesExample() 

    Solution without using third-party packages:

     dirs <- list.dirs(path = "some/path") library(shiny) ui <- shinyUI(bootstrapPage( selectInput("dir", "Choose dir", choices = dirs, selected = "."), verbatimTextOutput("dir") )) server <- shinyServer(function(input, output, session) { output$dir <- renderPrint(input$dir) }) shinyApp(ui, server) 

    You can filter the dirs variable before using it in selectInput or bring it into a more readable form ..

    • On the local machine, everything seems to be tolerable. If the package does not suit you, you can try to list.files + selectInput . - Artem Klevtsov
    • The package is very slow when I try to open folders on the local network, as a result, I probably will save up with dynamic selectInput Thank you! Thank you! - Batanichek