fileInput ( when upload is optional ) with observeEvent (when the file exceeds the size)

I have an app where the user can or cannot upload a file.
When there is a failed upload attempt, I would like to know.
I tried to use observeEvent with fileInput but when the failure occurs it behaves as if there had been no attempt.
I don't know which strategy to adopt. Would anyone have any tips?
I thank in advance for any help.
att.,
Cleber

below follows script trying to implement:

options( shiny.maxRequestSize="1024" )# 1kb

ui <- fluidPage( fileInput("file1", "Any File", accept = ".pdf" ) )

server <- function(input, output) {
observeEvent( input$file1, {
print("Now I know that an attempt was made to upload a file and it was unsuccessful")
})

}
shinyApp( ui, server )

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.