title: Uploading .pdf to Shiny, .pdf "Not Found"
body: <p>I can upload the .pdf file locally to my www/ folder, but when I try to display the newly uploaded file, it says it's &quot;Not Found&quot;.</p>
  <p>I'll paste my files here, and a screenshot of what it looks like from a webpage.</p>
  <p><a href="https://i.stack.imgur.com/FZozN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FZozN.png" alt="enter image description here" /></a></p>
  <p>server.R</p>
  <pre><code>    library(shiny)
  #CMD+SHIFT+ENTER to run app
  
  
  
  myServer &lt;- function(input, output, session) {
    observe({
      req(input$file_input)
      file.copy(input$file_input$datapath, paste0(&quot;www/&quot;, input$file_input$name), overwrite = T)
      
  
    output$pdfview &lt;- renderUI({
      tags$iframe(style=&quot;height:600px; width:100%&quot;, src=paste0(&quot;www/&quot;, input$file_input$name))
    })
  
    })
  }
  </code></pre>
  <p>ui.R</p>
  <pre><code>library(shiny)
  
  myUI &lt;- fluidPage(
    titlePanel(&quot;Testing File upload&quot;),
  
    sidebarLayout(
      sidebarPanel(
        fileInput('file_input', 'upload file ( . pdf format only)', accept = c(&quot;application/pdf&quot;, &quot;.pdf&quot;))
      ),
  
      mainPanel(
        uiOutput(&quot;pdfview&quot;)
      )
    )
  )
  </code></pre>
  <p>app.R</p>
  <pre><code>library(shiny)
  source(&quot;ui.R&quot;, local = TRUE)
  source(&quot;server.R&quot;)
  
  
  shinyApp(
    ui = myUI,
    server = myServer
  )
  
  shinyApp(ui, server)
  </code></pre>
  <p>I can go to my file folder and open the uploaded files and they have content and open in the browser. I have my R files outside of my www/ folder. I tried to do the localhost url instead of opening from www/, but I didn't understand the difference and &quot;localhost wouldn't connect&quot;</p>
  <p>Thank you in advance :)</p>