title: How to save current workspace in R Shiny
body: <p>I would like to allow my users to save their current workspace to a directory of their choosing. I am not able to make it work.</p>
  
  <p>Below is my code. Any suggestions? Thanks in advance.</p>
  
  <p><strong>ui.R:</strong></p>
  
  <pre><code>shinyUI(fluidPage(
    titlePanel("Save RData"),
    sidebarLayout(
      sidebarPanel(
      ),
      mainPanel(
        downloadButton('download_structure', "Save")
      )
    )
  ))
  </code></pre>
  
  <p><strong>server.R</strong></p>
  
  <pre><code>shinyServer(function(input, output) {
  
    output$download_structure &lt;- downloadHandler(
      filename = function() {paste("Test.RData")},
      content  = function(file) {
        list = ls(all.names = TRUE)
      }
    )
  
  })
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I also tried the following codes.  </p>
  
  <p>I entered "C:/Users/MyName/Desktop/" or "C://Users//MyName//Desktop//" as the input$RDdata_dir_save. Both are not working.</p>
  
  <p>Any suggestions would be really appreciated!</p>
  
  <p><strong>snippets of my ui.R:</strong></p>
  
  <pre><code>textInput("RData_name_save", "RData name"),
  textInput("RData_dir_save", "Save directory"),
  </code></pre>
  
  <p><strong>snippets of my server.R:</strong>    </p>
  
  <pre><code>tempdir  &lt;- paste0(input$RData_dir_save,input$RData_name_save,'.RData"')
  save.image(file=eval(parse(text=tempdir)))          
  </code></pre>