title: Generate report from shiny app with markdown : file not found
body: <p>I want to generate a pdf report from my shiny app on shiny server. It work well on my computer.
  I try to put in on my shiny server, but when i want to generate the report, I get a firefox "file not found" page instead of getting the pdf.</p>
  
  <p>I use the code shown at : <a href="https://shiny.rstudio.com/articles/generating-reports.html" rel="nofollow noreferrer">https://shiny.rstudio.com/articles/generating-reports.html</a>
  I also try to use directly my .Rmd file instead of copy/paste it to the temp dir, but I got the same error.</p>
  
  <p>My server file :</p>
  
  <pre><code>output$pdfGen &lt;- downloadHandler(
      # For PDF output, change this to "report.pdf"
      filename = "rapport_preci.pdf",
      content = function(file) {
        withProgress(message = "GÃ©nÃ©ration du pdf en cours", value = 0,{
          src &lt;- normalizePath('report.Rmd')
  
          # temporarily switch to the temp dir, in case you do not have write
          # permission to the current working directory
          owd &lt;- setwd(tempdir())
          on.exit(setwd(owd))
          file.copy(src, 'report.Rmd', overwrite = TRUE)
  
        # Set up parameters to pass to Rmd document
        params &lt;- list(varSite = input$pdfSite,
                       ...
                       varTrans= input$valTrans1
                       )
  
        # Knit the document, passing in the `params` list, and eval it in a
        # child of the global environment (this isolates the code in the document
        # from the code in this app).
        out &lt;- render("report.Rmd", output_file = file,
                          params = params,
                          encoding = "UTF-8"
        )
        file.rename(out, file)
        })
      }
    )
  </code></pre>
  
  <p>I think my app does not found my .Rmd file, but how do I fix that ? All my files are in the same folder.</p>