Parametized Rmarkdown with fileinput on Rstudio Connect New

Hi @Rodrigue

Thanks for opening this!! We had another customer raise this issue somewhat recently as well. It is unclear that this should ever have worked, since the place that this file is written to is destroyed almost immediately. It may have been a change to Connect's execution environment that enforces the "quickness" for the destruction since that last thread, though.

We are tracking internally a way to support this functionality better, and will definitely add your vote!

A few possible workarounds in the short term are below. Would any of these work within your organization?

  • Have a location where users can upload files that makes these files accessible over a file share or URL. In the parameterized R Markdown report, instead of a fileInput widget, the user can enter the URL or path to the file (in a textInput). Access control for these URLs / file paths and segregating the data by user may be a bit challenging, if that is important to your use case. However, you could always "secure" this data through obscurity using a UUID, for instance.

  • The problem you are experiencing will not affect fileInput widgets in a Shiny application. As a result, you can also build a simple Shiny application that accepts a fileInput widget and then generates output or runs an R Markdown report. This unfortunately does not utilize Connect's scheduling / managing / output storing functionality for Parameterized R Markdown documents.

  • In the newest version of Connect, you can even use a pin, described here: https://blog.rstudio.com/2019/09/23/rstudio-connect-1-7-8-put-a-pin-in-it/

As an example of what a combination might look like, I could create a Shiny application or Plumber API that allows users to "upload" data and then hosts it somewhere that it is accessible either on the filesystem or over a REST API (Plumber, pin, etc.). That file path / URL could then be copied into a textInput in the R Markdown report and the code can pick up the data from that path. Another workaround would be to create a file share that they can move files to which is accessible to their desktops and to the RStudio Connect server and files can be sourced from that location.

I'd love to have a working example of an easy way to make this pattern work, since Connect's fileInput widget is not functional today.