Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- ui <- shinyUI(fluidPage(
- titlePanel("Testing File upload"),
- sidebarLayout(
- sidebarPanel(
- fileInput('file_input', 'upload file ( . pdf format only)', accept = c('.pdf'))
- ),
- mainPanel(
- uiOutput("pdfview")
- )
- )
- ))
- server <- shinyServer(function(input, output) {
- observe({
- req(input$file_input)
- file.copy(input$file_input$datapath,"www", overwrite = T)
- output$pdfview <- renderUI({
- tags$iframe(style="height:600px; width:100%", src="0.pdf")
- })
- })
- })
- shinyApp(ui = ui, server = server)
Add Comment
Please, Sign In to add comment