View source: R/selectFileModule.r
selectFileUI | R Documentation |
Module UI function for file selection
selectFileUI(id, label = "Select file", title = "", multiple = FALSE)
id |
string namespace id for module (same as in server) |
label |
text to appear on select file button eg "Select file" |
title |
text title for button (not used) default "" |
multiple |
TRUE for allowing mutiple selection, default FALSE to select single file |
Select File Module UI used with selectFileServer modified from https://stackoverflow.com/questions/38747129/how-to-use-shinyfiles-package-within-shiny-modules-namespace-issue
datapath path of selected file ( relative to root_dirs argument in fileSelectServer)
#simple file selection shiny app
library(shiny)
ui <- fluidPage(
selectFileUI(
id = "fileSelect1",label ="Select File"
),
textOutput("datapath")
)
server <- function(input, output, session) {
rv<-reactiveValues()
x <- selectFileServer(id = "fileSelect1")
observe(rv$datapath<-x$datapath)
observe(output$datapath<-renderText(rv$datapath))
}
shinyApp(ui,server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.