2

Can files be uploaded to server using the shinyFiles package? I'm looking for similar functionality to the standard fileInput from the shiny package. The closest thing I could find in shinyFiles:

app.r

library(shiny) library(shinyFiles) server <- function(input, output, session) { shinyFileSave(input, 'save', session=session, roots=c(wd='.')) } ui <- bootstrapPage(shinySaveButton('save', 'Save', 'Save as...')) shinyApp(ui=ui,server=server) 

But this only allows me to browse the server files (not local) and even when I save I don't see the file created.

0

1 Answer 1

2

The short answer is no (sorry about that)... shinyFiles is simply a browser for the server file system, mainly intended for use when a shiny app is meant for local use (to avoid the overhead of file copying required in native web implementations).

The functionality of shinyFileSave is simply to let the user specify a non-existing filename at a certain location and pass that information back to the server - It's up to the server logic to handle that information in a meaningful way, by creating a file at the specified location.

You could somehow couple shinyFileSave and fileInput to upload a file and put it in a specific location, but the UI for this would probably be quite messy as it would inevitably mix shinyFiles/Bootstrap ui with native ui elements. As the local filesystem is guarded from Javascript code for security reasons this would be the only approach though as long as the server and client resides at different locations...

Sign up to request clarification or add additional context in comments.

1 Comment

Is there any update on this? I am also having the same issue with uploading the files onto the server using the shinyFileSave option.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.