Download XLS from API into R Shiny

I have a R Shiny app working well taking data, sending it to python Flask API server for data cleaning, and the output intended sent back to Shiny as an XLS download. However, I'm struggling how to automatticaly receive that XLS in Shiny. Here is my Shiny code:

  get_cleaned_xls <- function(upload_id) {
load_url <- paste0(BACKEND_URL, "/v1/download_cleaned_data/", upload_id)
load_request <- httr::GET(load_url)
load <- httr::content(load_request)
message('get_cleaned_xls', upload_id)
paste(load, ".xls", sep = "")
write.xlsx(load, file = 'test.xlsx', asTable = TRUE, borders = "columns", firstRow = TRUE, colWidths = "auto")

The "load" is the actual XLS.

figured it out, I was looking for "write_disk"

1 Like

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