Skip to content

Commit

Permalink
upload
Browse files Browse the repository at this point in the history
  • Loading branch information
“rafal.urn” committed Aug 18, 2024
1 parent 58a9ec0 commit 631db96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion inst/source/tabs/tab1/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))

})
2 changes: 1 addition & 1 deletion inst/source/tabs/tab1/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ fluidPage(
br(),
fileInput(ns("UploadProjectFile"), NULL, accept = ".zip", multiple = FALSE),
HTML("</center>"),
verbatimTextOutput(ns('contents'))
)
)

verbatimTextOutput(ns('contents'))

# zawsze ns() do id !!!!! lacznie z output każdy id z ns() !!!!!

0 comments on commit 631db96

Please sign in to comment.