title: r shiny - upload all files from shinyDirChoose folder to server
body: <p>I saved the path of a user-defined folder with <code>shinyDirChoose</code>. Now I want to upload files from that user's folder, but I cannot figure out how to do it. 
  1) All on the server end?
  2) Feeding the file paths to <code>fileInput</code> somehow?</p>
  
  <p>This is how I construct the file paths for the three files that should be uploaded.</p>
  
  <pre><code>### ui end, to browse to desired folder
  ui = fluidPage(shinyDirButton('directory', 'Folder select', 'Please select a folder'))
  
  ### extracting the folder path
  server = function(input, output, session) {
      volumes &lt;- getVolumes()
      shinyDirChoose(input, 'directory', roots=volumes, session=session)
      path1 &lt;- reactive({
         return(print(parseDirPath(volumes, input$directory)))
      })
  
  ### constructing the 3 file paths
  datpat &lt;- renderText({
      req(nchar(path1())&gt;0)
      datpat &lt;- paste0(path1(),"/data.csv")
    })
  vispat &lt;- renderText({
      req(nchar(path1())&gt;0)
      vispat &lt;- paste0(path1(),"/visit.csv")
    })
  statpat &lt;- renderText({
     req(nchar(path1())&gt;0)
     statpat &lt;- paste0(path1(),"/statvisit.csv")
  })
  </code></pre>
  
  <p>So now I have these paths, but how can I use them to upload the related content to the server? A simple <code>read.csv</code> unfortunately does not do the trick.</p>
  
  <p><strong>EDIT - but not there yet...</strong></p>
  
  <p>Working further with the great help @SBista provided, I think I'm approaching my goal, but see below code...</p>
  
  <pre><code>volumes &lt;- getVolumes()
  shinyDirChoose(input, 'directory', roots=volumes, session=session)
  path1 &lt;- reactive({
    return(print(parseDirPath(volumes, input$directory)))
  })
  
  observe({
    if(!is.null(path1)){
      ### vis1
      vis1 &lt;- reactive({
        datpat &lt;- paste0(path1(),"/visit.csv")
        vis &lt;- read.csv(datpat, header = input$header, sep = input$sep, quote = input$quote,
                        stringsAsFactors = FALSE)
        vis
      })
      ### dataruw1
      dataruw1 &lt;- reactive({
        datpat &lt;- paste0(path1(),"/data.csv")
        dataruw &lt;- read.csv(datpat, header = input$header, sep = input$sep, quote = input$quote,
                            stringsAsFactors = FALSE)
        dataruw
      })
    }
  })
  </code></pre>
  
  <p>Unfortunately, <code>dataruw1</code> and <code>vis1</code> do not seem to be generated, as I get a 'could not find function' error when trying to use the actual data with <code>dataruw1()</code> and <code>vis1()</code>. What am I missing? Any idea? Thanks a lot in advance!</p>