cirofdo
cirofdo

Reputation: 1074

How can my Shiny App in shinyapps.io load local data?

I want my shiny app to load the data from the user computer, for security reasons. I don't want to upload the data, I want to send the user the file, and when he opens the app on shinyapps.io, it will load the data from his computer (A .csv located inside C:/, for example).

An ideal solution would be to the user to chose the file from his computer, but any of these will help a lot.

Thanks

Upvotes: 1

Views: 1820

Answers (2)

krish
krish

Reputation: 1438

If you have just one file, you can try using the read.csv(file.choose()) function inside the global.R file if that works with you application requirement.

If there are multiple files that you want to load, I guess using the fileInput is a better option. You can get some help with using it here:

http://shiny.rstudio.com/gallery/upload-file.html

https://gist.github.com/psychemedia/9737637

Upvotes: 1

Mark Peterson
Mark Peterson

Reputation: 9570

I believe that you are looking for the shiny function fileInput which allows a user to upload one (or several) files that you can then handle (generally within a reactive function) and pass to your other outputs.

Upvotes: 1

Related Questions