A Server-Side File System Viewer for Shiny

Provides functionality for client-side navigation of the server side file system in shiny apps. In case the app is running locally this gives the user direct access to the file system without the need to "download" files to a temporary location. Both file and folder selection as well as file saving is available.


Travis-CI Build Status CRAN_Release_Badge CRAN_Download_Badge

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

shinyUI(bootstrapPage(
    shinyFilesButton('files', label='File select', title='Please select a file', multiple=FALSE)
))

In the server.R file

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 <button> element. The equivalent of the above in raw html would be:

<button id="files" type="button" class="shinyFiles btn" data-title="Please select a file" data-selecttype="single">
    File select
</button>

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 (http://www.fatcow.com/free-icons)
  • RStudio is a trademark of RStudio, Inc. File icons used by permission of RStudio, Inc.

News

shinyFiles 0.7.3

  • Check parent existence when attempting to navigate 'down' in directory selection to avoid down-arrow freeze (@AFriendlyRobot, PR118)
  • Return the epoch in milliseconds from the server (@keqiang, PR1113)
  • Allow launching shinyFiles from within a shiny modal (@ifellows, PR111)

shinyFiles 0.7.2

  • Sort files and folders by modification date or creation date in dir chooser (@AFriendlyRobot PR105)
  • Fix for softlinks / shortcuts used with shinyDirChoose by @raggaraluz PR104
  • Resizing modal (@Unfriendly PR100)

UI improvement listed below by @AFriendlyRobot PR97

  • Close modal with escape key or by clicking outside the modal, i.e., the equivalent of easyClose for Shiny modals (#76)
  • Open a folder with the enter key (#63)
  • Double click file to select and close modal (#74)
  • Navigate file and folder selection with arrow keys
  • Select with the Enter, i.e., a shortcut to click the select button. Enter should open a folder but select a file + close modal
  • Save on Enter in textinput for file save modal (i.e., equivalent of clicking the select button)
  • A refresh button to update the list of files and directories shown
  • Refresh the file and folder information when a shinyFiles button is clicked

shinyFiles 0.7.1

  • Close modal on ESC (@vnijs)
  • Force file selection on double click (@AFriendlyRobot PR95)
  • shinyFiles now uses the fs package and works with Chinese, Russian, etc. characters (@vnijs PR92)
  • Use select file type icons from Rstudio with permission (@vnijs PR86)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("shinyFiles")

0.7.3 by Thomas Lin Pedersen, 6 months ago


https://github.com/thomasp85/shinyFiles


Report a bug at https://github.com/thomasp85/shinyFiles/issues


Browse source code at https://github.com/cran/shinyFiles


Authors: Thomas Lin Pedersen [cre, aut] , Vincent Nijs [aut] , Thomas Schaffner [aut] , Eric Nantz [aut]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports htmltools, jsonlite, tools, shiny, fs, tibble


Imported by CytobankAPIstats, SSDM, bdDwC, dataesgobr, dextergui, gitgadget, radiant.data, samr, strataG, xROI.

Depended on by Eagle, skeleSim.

Suggested by cronR.


See at CRAN