Shinyapps: save answer from a shiny app online

Hi everyone, my name is a Gabriele, I'm a new subscriber.
I'm not an R expert but I really need it to create a survey for Stated Preference Experiments (DCE).
Basically I tried to replicate the function SurveyApp of the idefix package creating a shinyapp.
The app works offline storing the answers in .csv file but doesn't work when I try to answer online. Then I tried to store them on dropbox but it still doesn't work.

This is only the final part of the code

observeEvent(input$OK, {
if (input$OK > n.total) {
output$end <- renderText(end.text)
}
if (input$OK > (n.total+1 )) {
if (!is.null(data.dir)) {

    write.csv(surveyData, 'mtcars.csv')
    
    drop_upload('mtcars.csv', path = "drop_test")
    new_iris <- drop_read_csv("mtcars.csv")
        
  }
    
 stopApp()
}

})

Thank you in advance for your help