How to import remote csv file on a deployed shiny app?

Viewed 25

I try to create an shiny app that allows to upload csv data and manipulate them (simplified example).

When the app is not deployed, no problem to upload local csv throught shinyFilesButton:

library(shiny)
library(shinyFiles)

ui <- shinyUI(pageWithSidebar(
  headerPanel(
    'Selections with shinyFiles',
    'shinyFiles example'
  ),
  sidebarPanel(
    shinyFilesButton('file', 'File select', 'Please select a file', FALSE)
  ),
  mainPanel(
    tags$h4('The output of a file selection'),
    tableOutput("contents")
  )
))

server <- shinyServer(function(input, output, session) {
  volumes = getVolumes()
  shinyFileChoose(input, 'file',  roots = volumes, filetypes=c('', 'csv'))
  output$contents <- renderTable({
    inFile <- parseFilePaths( roots = volumes, input$file)
    if( NROW(inFile)) {
      df <- read.csv(as.character(inFile$datapath))
    }
  })
})

shinyApp(ui = ui, server = server)

We clearly see all the stucture needed: enter image description here

But when the app is deployed, impossible to find any file. Here is the deployed app: https://charlottesirot1985.shinyapps.io/Server/.

enter image description here

As I understand the app/server has no access to remote data ? Do I understand correctly ?Or maybe it is not the same "home" (I guess so...)

How to work around ?? How to work on remote data with deployed shiny app ?

Thanks in advance for your answer !

Charlotte

0 Answers
Related