In my brilliant application, I want to be able to click the download button, execute the function that I have (in the package) that creates a pdf file in the / results folder, and then offers this brilliant application user as the download. I pasted my current download_portfolio download code from the server below (so many parts are not sure how I can make it reproducible). I wanted to find out if anyone has an idea of ββwhat is going wrong, I get an error message below, however, the FUNCTION_TO_GENERATE_PDF_IN_ / results () function starts and creates a PDF file, but then the application is restarted and the user is never asked to download.
The error I get (but the pdf code is still generated correctly from my function, just restarting the application and there is no suggestion to download the pdf file).
Error in self$downloads$set(name, list(filename = filename, contentType = contentType, : argument "content" is missing, with no default
app.R code where I work on loading
observe({ output$download_portfolio <- downloadHandler({ FUNCTION_TO_GENERATE_PDF_IN_/results() filename = function() { paste(input$pdfname) } content = function(file) { file.copy(paste("results/",input$pdfname, file, overwrite = TRUE) } }) })
source share