diff --git a/inst/source/tabs/tab1/server.R b/inst/source/tabs/tab1/server.R index 993c7d2..97b1a22 100644 --- a/inst/source/tabs/tab1/server.R +++ b/inst/source/tabs/tab1/server.R @@ -4,10 +4,20 @@ # Upload Project File output$contents <- renderText({ + # Upload file <- input$UploadProjectFile ext <- tools::file_ext(file$datapath) - req(file) validate(need(ext == "zip", "Please upload a zip file")) + # Unzip + path <- dirname(file$datapath) + utils::unzip(file$datapath, exdir = path) + + # Copy to Temp Proj Dri + file.copy(paste0(path,'/config.yaml'), config$TempProjPath, recursive=TRUE) + file.copy(paste0(path,'/tabs'), config$TempProjPath, recursive=TRUE) + + as.character(paste0(path,"/+/" ,config$TempProjPath)) + }) \ No newline at end of file diff --git a/inst/source/tabs/tab1/ui.R b/inst/source/tabs/tab1/ui.R index 43ec4fc..65fe136 100644 --- a/inst/source/tabs/tab1/ui.R +++ b/inst/source/tabs/tab1/ui.R @@ -25,9 +25,9 @@ fluidPage( br(), fileInput(ns("UploadProjectFile"), NULL, accept = ".zip", multiple = FALSE), HTML(""), + verbatimTextOutput(ns('contents')) ) ) -verbatimTextOutput(ns('contents')) # zawsze ns() do id !!!!! lacznie z output każdy id z ns() !!!!!