Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thomasp85/shinyFiles
A shiny extension for server side file access
https://github.com/thomasp85/shinyFiles
filemanager rstats shiny ui-components
Last synced: 3 months ago
JSON representation
A shiny extension for server side file access
- Host: GitHub
- URL: https://github.com/thomasp85/shinyFiles
- Owner: thomasp85
- Created: 2014-05-23T10:50:19.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T20:43:26.000Z (over 1 year ago)
- Last Synced: 2024-07-19T13:26:45.819Z (4 months ago)
- Topics: filemanager, rstats, shiny, ui-components
- Language: JavaScript
- Size: 1.23 MB
- Stars: 193
- Watchers: 11
- Forks: 46
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-shiny-extensions - shinyFiles - A server-side file system viewer for Shiny. (UI Components / File Input)
- jimsghstars - thomasp85/shinyFiles - A shiny extension for server side file access (JavaScript)
README
# shinyFiles
[![R-CMD-check](https://github.com/thomasp85/shinyFiles/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/thomasp85/shinyFiles/actions/workflows/R-CMD-check.yaml)
[![CRAN\_Release\_Badge](http://www.r-pkg.org/badges/version-ago/shinyFiles)](https://CRAN.R-project.org/package=shinyFiles) [![CRAN\_Download\_Badge](http://cranlogs.r-pkg.org/badges/shinyFiles)](https://CRAN.R-project.org/package=shinyFiles)This package extends the functionality of shiny by providing an API for client side access to the server file system. As many shiny apps are run locally this is equivalent to accessing the filesystem of the users own computer, without the overhead of copying files to temporary locations that is tied to the use of `fileInput()`.
The package can be installed from CRAN using `install.packages('shinyFiles')`.
Usage
----------
The package is designed to make it extremely easy to implement file system access. An example of implementing a file chooser would be:In the ui.R file
```R
shinyUI(bootstrapPage(
shinyFilesButton('files', label='File select', title='Please select a file', multiple=FALSE)
))
```
In the server.R file
```R
shinyServer(function(input, output) {
shinyFileChoose(input, 'files', root=c(root='.'), filetypes=c('', 'txt'))
})
```It is equally simple to implement directly in your custom html file as it only requires a single `` element. The equivalent of the above in raw html would be:
```htmlFile select
```
For an overview of all the different modules try the `shinyFilesExample()` function in the package. It gives an overview of all the necessary code, along with descriptions and working examples.
Credits
----------
* The file icons used in the file system navigator are taken from FatCows Farm-Fresh Web Icons (https://www.fatcow.com/free-icons)
* RStudio is a trademark of RStudio, Inc. File icons used by permission of RStudio, Inc.