Description Usage Arguments Example uploading a file See Also Examples
Upload files to the server.
1 2 3 4 5 6 7 8 |
id |
A character string specifying the id of the reactive input. |
placeholder |
A character string specifying the text inside the file
input, defaults to |
browse |
A character string specifying the label of file input, defaults
to |
... |
Additional named arguments passed as HTML attributes to the parent element or tag elements passed as child elements to the parent element. |
multiple |
One of |
accept |
A character vector of possible MIME types or file extensions,
defaults to |
shinyApp( ui = container( fileInput("upload") %>% margin(0, "auto", 0, "auto") ), server = function(input, output) { observe({ req(input$upload) print(input$upload) }) } )
Other inputs:
buttonGroupInput()
,
buttonInput()
,
checkbarInput()
,
checkboxInput()
,
chipInput()
,
formInput()
,
listGroupInput()
,
menuInput()
,
navInput()
,
radioInput()
,
radiobarInput()
,
rangeInput()
,
selectInput()
,
textInput()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ### Standard file input
fileInput(id = "file1")
### Adding a button
fileInput(
id = "file2",
left = buttonInput("upload", "Upload") %>%
background("green")
)
### Customizing text
fileInput(
id = "file3",
placeholder = "Pick a file",
browse = "Go go go!"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.