shiny interface to download from ftp to the user computer

Hello everyone,

I'm working on a shiny app to allow user selecting easily only a few files on a ftp and to download them. So far I was only using functions to filter the data and to download them (with download.files for example) directly with R, then I thought it could be nice to use shiny to do it...

I have build the interface and the filter but I'm struggling with the downloading part. I can't figure out how to tell to shiny download the selected files from the ftp to the computer of the guy using the app. Would it be even possible? As a solution I may provide a script that the user can run on its personal computer to download the filtered files from the ftp.

Sorry, I may provide some code if needed but the question is kinda 'more general',
Thank you for your help & sorry if it's not the right place to ask,
Cheers

If you are using a Linux server environment, the shinyFiles package is great for this situation. You can mount a file share on the server and force shinyFiles to only look in that directory. You have much more fine grained control of how users navigate the folder structure.

1 Like

thank you very much for your suggestion! I'll give I try!

I'm not the owner of the server where the data are and was thinking of uploading the app (2 download the data) on shinyapps.io. Thus if the user select where he wants the data in his computer I guess I can make it from the data server to his computer directly!

I don't think your shinyapp can help the user download directly from ftp to the computer. I think one solution is to have your shiny apps to download the files first from the ftp to a tmp folder, then your user downloads the files from the shinyapp to his computer. And this is completely feasible.

however, but I don't have ftp to try, it is possible that if you provide to the client in browser a link to ftp, it would be like http and the browser can download directly. But I am not sure.

Otherwise, you could see your shiny apps as a helper to know which command to use. You shinyapps could show the user the code that needs to be run locally.

Just some ideas...

1 Like

Thank you for your advices,

Using shinyfiles I manage to do the job when it runs locally but as soon as it goes to shinyapps.io the shinyfiles refers to the server side thus i'm not able to get the client side information!

Unfortunately the double download won't be a solution I guess! Even if the files are quit small there is a large number! The idea of providing some command to download could be an option as to provide a script to run locally to download the data!

I'm not sure what you mean by providing a link nevertheless thank you for your help,

cheers

1 Like