简体   繁体   中英

Choose dir shiny

I have simple shiny app which run on my local PC and avaliable for users in my intranet. I tried to add button to choose folder.

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())})
    }


  })

})

It works ok on my PC, but when someone use it in intranet(other PC) window to choose folder opens in my PC.

is there way to open choose folder on client PC?

Best option what i can find its library shinyFiles ( answer from RU_SO )

This package allow navigate throught server file system.

see shinyFilesExample()

But for me its work a bit slow and i plan to use simple dunamic selectInput with list.dirs(path = "some/path")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM