Inclusion of file remove and spinner on download

This commit is contained in:
2019-04-16 14:09:42 +01:00
parent 25da02896d
commit f0569918f5

14
app.R
View File

@@ -643,7 +643,10 @@ server <- function(input, output, session) {
zipFile <- zipr(paste0("tmp/MESO-", format(Sys.time(), "%m%d_%H%M"), ".zip"), c("tmp/layer1.png", "tmp/layer2.png", "tmp/layer3.png", "tmp/dataset.xlsx"))
print(paste("zip file complete", zipFile))
file.remove("tmp/layer1.png")
file.remove("tmp/layer2.png")
file.remove("tmp/layer3.png")
file.remove("tmp/dataset.xlsx")
return(zipFile)
}
@@ -659,8 +662,17 @@ server <- function(input, output, session) {
output$download <- downloadHandler(
filename = paste0("MESO-", format(Sys.time(), "%m%d_%H%M"), ".zip"),
content = function(file) {
showModal(
modalDialog(
fluidRow(
column(width = 12) %>% withSpinner(type = 5, proxy.height = "200px")
),
footer=div()
)
)
fName <- export(modelList[[.selections$model]])
file.copy(fName, file)
removeModal()
},
contentType = "application/zip"
)