Uploading file to R Studio Server with scripting (instead of clicking upload)
Asked Answered
G

1

6

I work on a R Studio Server and I want to upload a file to the Server. I know how to do this by clicking on the upload button.

https://support.rstudio.com/hc/en-us/articles/200713893-Uploading-and-Downloading-Files

1.Switch to the Files pane

2.Navigate to the directory you wish to upload files into

3.Click the Upload toolbar button

4.Choose the file you wish to upload and press OK

Is there a way to do this with code?

Gwen answered 6/3, 2019 at 14:19 Comment(3)
Did you ever find the answer to this question? I have the same question and would be very curious to know the answer.Werner
Same question here. Answer is very welcome!Roseline
Already a while since the question was asked. I didn't find a solution in R to do this. In the end we used Winscp like you can see in the small example. Not that handy but it helped us to exchange data between the server and our file system automatically. P:\HV\Programs\WinSCP.exe /log=H:\tmp\winscp.log /command "open sftp://user:passwd@IP/" "get /data/R/example.csv H:\tmp\" "exit"Gwen
S
1

On Linux, that's actually not a thing using scp.

scp /path/foo.txt user@server:/path/

You might be asked for credentials.

It also works from within R.

system('scp /path/foo.txt user@server:/path/')
Suntan answered 20/12, 2023 at 16:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.