Guest User

Untitled

a guest
Nov 22nd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. library(shiny)
  2.  
  3. ui <- shinyUI(fluidPage(
  4.  
  5. titlePanel("Testing File upload"),
  6.  
  7. sidebarLayout(
  8. sidebarPanel(
  9. fileInput('file_input', 'upload file ( . pdf format only)', accept = c('.pdf'))
  10. ),
  11.  
  12. mainPanel(
  13. uiOutput("pdfview")
  14. )
  15. )
  16. ))
  17.  
  18. server <- shinyServer(function(input, output) {
  19.  
  20. observe({
  21. req(input$file_input)
  22.  
  23.  
  24.  
  25. file.copy(input$file_input$datapath,"www", overwrite = T)
  26.  
  27.  
  28.  
  29. output$pdfview <- renderUI({
  30. tags$iframe(style="height:600px; width:100%", src="0.pdf")
  31. })
  32.  
  33. })
  34.  
  35. })
  36.  
  37. shinyApp(ui = ui, server = server)
Add Comment
Please, Sign In to add comment