Skip to content

Commit

Permalink
zip
Browse files Browse the repository at this point in the history
  • Loading branch information
“rafal.urn” committed Aug 18, 2024
1 parent 97770bd commit c1db425
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
10 changes: 6 additions & 4 deletions inst/source/tabs/tab1/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@


# Upload Project File
output$contents <- renderTable({
file <- input$file1
output$contents <- renderText({

file <- input$UploadProjectFile
ext <- tools::file_ext(file$datapath)

req(file)
validate(need(ext == "csv", "Please upload a csv file"))
validate(need(ext == "zip", "Please upload a zip file"))

as.character(file)

read.csv(file$datapath, header = input$header)
})
12 changes: 2 additions & 10 deletions inst/source/tabs/tab1/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,9 @@ fluidPage(
br(),
fileInput(ns("UploadProjectFile"), NULL, accept = ".zip", multiple = FALSE),
HTML("</center>"),

sidebarLayout(
sidebarPanel(
fileInput(ns("file1"), "Choose CSV File", accept = ".csv"),
checkboxInput("header", "Header", TRUE)
),
mainPanel(
tableOutput(ns("contents"))
)
)
)
)

verbatimTextOutput(ns('contents'))

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

0 comments on commit c1db425

Please sign in to comment.