Hi i am a newbie at R and shiny.. i would like to rename the user upload file in my shiny app. I want R to work with a single name file regardless of that what ever the file name uploaded by user.
library(shiny)
ui<-fluidPage(
titlePanel(title = h1(" ALPHA DIVERSITY", align="center")),
sidebarLayout(
sidebarPanel(
fileInput("shared","Upload shared file:"),
fileInput("upload","Upload design file:"),
),
mainPanel
(
tabsetPanel(
))
server<-function(input,output,session){
share<-reactive({
req(input$shared)
share1<-read.table(input$shared$datapath, header=T)
})
observe({
if (is.null(input$shared)) return()
file.rename(input$shared$datapath(shared), paste0(tempdir(),temp.txt))
}
# i tried this to save user uploaded file as a fixed name for further processing of that uploaded file but failed.