I have built a shiny app that will allow users to upload a pdf file then upload that file to Rstudio Connect. I tested the app and it works, I am only struggling with the tagging. Is it possible to create code that will get the uploaded file tagged in the correct area? I have already created a tag scheme on Rstudio Connect. Here is my code for the shiny app thus far:
ui <- fluidPage(
titlePanel("ESD Flash Report Upload"),
fluidRow(
h4("This is an application that allows you to upload your flash report onto Rstudio Connect. Please upload only PDF files and provide the name of the flash report as well as the publication date (eg: Mining Production - January 2020)"),
fileInput(inputId = "file", label = "Upload flash report", multiple = FALSE, placeholder = "No file selected", accept = "pdf"),
textInput("pubname", "Enter publication name", value = ""),
textInput("pubdate", "Enter publication date", value = ""),
actionButton(inputId = "upload", label = "Upload file")
))
server <- function(input, output){
observeEvent(input$upload, {
require(input$file)
file.copy(from = input$file$datapath,
to = paste0(tempdir(),
input$pubname,
" - ",
input$pubdate,
".pdf"))
rsconnect::deployDoc(doc = paste0(tempdir(),
input$pubname,
" - ",
input$pubdate,
".pdf"),
account = "P",
server = "srv")
}
)
}
shinyApp(ui = ui, server = server)