mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-01 02:05:51 -05:00
This feature is currently pretty rough. It only works in the most modern browsers (depends on HTML5 File API, including Blob.slice) and doesn't show upload progress.
19 lines
531 B
R
19 lines
531 B
R
library(shiny)
|
|
|
|
shinyServer(function(input, output) {
|
|
output$contents <- reactiveTable(function() {
|
|
|
|
# input$file1 will be NULL initially. After the user selects and uploads a
|
|
# file, it will be a data frame with 'name', 'size', 'type', and 'data'
|
|
# columns. The 'data' column will contain the local filenames where the data
|
|
# can be found.
|
|
|
|
inFile <- input$file1
|
|
|
|
if (is.null(inFile))
|
|
return(NULL)
|
|
|
|
read.csv(inFile$data, header=input$header, sep=input$sep, quote=input$quote)
|
|
})
|
|
})
|