Hello,
I am using downloadButton widget and downloadHandler server side. I would like to download a folder. To do this I have to zip the folder.
When i click on download button i get a text document type file. When I save it, I get nothing.
# print(getwd()) [1] "C:/Users/user/Workspace/project/shinyapp"
# the folder is in : "C:/Users/user/Workspace/project/results"
downloadHandler(
filename = function(){ paste0("zipfile", ".zip") },
content = function(file){
# print(file) "C:\\Users\\user~1\\AppData\\Local\\Temp\\RtmpsrFrQB\\file42a44f144187.zip"
tempZip <- tempfile()
# print(tempZip") "C:\\Users\\user~1\\AppData\\Local\\Temp\\RtmpsrFrQB\\file42a432e645aa"
zip(tempZip, files = "../results/folder")
file.copy(tempZip, file)
},
contentType = "application/zip"
)