Reset FileInput

Hi,

I have a shiny app with multiple FileInput objects.

I created a reset button to clear the file from the FileInput object, but it does not work. I know the file is cached in the shiny memory, but I just want to reset the FileInput object to look like how it originally did before I uploaded the file, when I press the reset button.

I googled a bit and found most people get around this problem using shinyjs, but shinyjs does not work in the R package I am creating so I am trying to find a work around.

Here is example from my ui.R code

             #Upload qPCR Experimental Fluorescence File
                       fileInput("DS_qpcr_file",
                                 "Upload qPCR Experimental Fluorescence File (csv/xlsx/xls)",
                                 multiple = FALSE,
                                 accept = c(".csv", ".xlsx", ".xls"))),

Here is my server code

 #Reset uploaded file input 
  observeEvent(input$DS_reset, {
    
    fileInput("DS_qpcr_file",
              "Upload qPCR Experimental Fluorescence File (csv/xlsx/xls)",
              multiple = FALSE,
              accept = c(".csv", ".xlsx", ".xls"),
              placeholder = "Please upload file..")
})
    

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.