... Hello
I am hoping to get some help if possible. I am trying to build an app that allows users to upload a PDF file onto the app then the app deploys the PDF file to Rstudio Connect. Even if the file does not get uploaded onto the app but essentially I need the app to deploy a PDF document onto Rstudio Connect. I have built an app that allows a user to upload a file onto the app but after uploading the file does not appear on the app. Here is my code below:
library(shiny)
# Define UI for application
ui <- fluidPage(
# Application title
titlePanel("Upload file"),
sidebarLayout(
sidebarPanel(
fileInput('file1', 'upload PDF file', accept = c('.pdf'))
#multiple = TRUE,
#accept = c("pdf",
#".pdf")),
),
mainPanel(
uiOutput("pdfview")
)
)
)
# Define server logic required
server <- function(input, output) {
library(pdftools)
mypdf<-reactive({
inFile <- input$file1
if (is.null(inFile)){
return(NULL)
}else{
pdf_text(inFile$datapath)
tags$iframe(style="height:600px; width:100%", src="0.pdf")
}
})
}
# Run the application
shinyApp(ui = ui, server = server)
The App works but it does not display the upload PDF file
Thanks