j_kraut
1
I'm trying to modify filename output in the Download Handler in R Shiny
activeUploadId <- reactiveVal(NULL)
output$cleanedDownload <- downloadHandler(
filename = activeUploadId(),
content = function(file) file.copy(paste0("cleaned/", activeUploadId()), file))
Get this error: 'x' is NULL so the result will be NULL
Warning: Error in <-: replacement has length zero
I've also tried a filename with a function and unable to find a way to assign a filename (it changes for each user/processing).
I'm a little unclear. What value do you want the filename to take? Do you want it to depend on a user input, or do you just want some unique value?
j_kraut
3
I would want it to depends on user input.
Okay, a simple way would be something like this:
ui <- fluidPage(
...
textInput('file', 'Enter File Name (without extension)')
)
server <- function(input, output, session) {
...
output$cleanedDownload <- downloadHandler(
filename = paste0(input$file, '.ext'),
content = function(file) file.copy(file_to_be_copied, file)
}
system
Closed
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.