How to save a shiny output table in a directory

In my simple shiny app, I intend to save the output table in a directory when clicking on the action button. Although I put a download button in the app I need to save the output in my directory. This is because when users forget to click on the download button, I would have the result on my computer to share with them.

Hi sana,
In my application (https://demography.dola.colorado.gov/colorado-demographic-profiles/) users have the tools to save and download tables., by clicking on a button.
The program creates a table in a word document via the flextable and officer packages, and then clicking on the download button delivers the table to a users' download folder.
I'm not sure that this is what you want, but my point is that the table is constructed independently in multiple ways (using kable to generate the HTML code for the shinydashboard, and flextable to create an object for the download) and then shiny functions like downloadHandler take it from there.

HTH
AB

Hi Adambickford,

Thank you for your reply. Users of my application can also download the tables but what I really need is when someone uses my app a copy of the table can be saved in my own directory as a main repository. Therefore, if users couldn't download their result or forget to do that I would be able to send it to them. I'm still searching for how to do that and not sure if it is doable.

Thanks

Hi sana,
Would you be able to set a directory path to a folder and have a second copy of a table saved there? I can imagine two scenarios: saving a copy in your designated folder whenever a user chooses to save a table (which can be done in the downloaadHandler) or just saving everything each time your application is run.

Adding a path name into the downloadHandler is straight forward. I suppose you'd need to send a notification to the user, but that should be possible too.

HTH
AB

As you can see in the codes I set this directory and added some codes to save the outputs but they did not work. Would you please let me know the codes I can add to the provided ones to fix the error or any sample codes you have for what you are mentioning?

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.