How to upload a file to a server via FTP using R?

前端 未结 4 1171
谎友^
谎友^ 2020-12-09 11:58

How to upload a file to a server via FTP using R?

相关标签:
4条回答
  • 2020-12-09 12:04

    This probably isn't the answer you're looking for, but I solve my sharing problems by moving the file to my Public dropbox folder and link to that in my R code.

    My two pennies.

    0 讨论(0)
  • 2020-12-09 12:06

    If you can access it from the command line, then you can do:

    system("ftp ...") # where ... is the argument list
    

    You could easily wrap this in an R function if you plan on doing it often.

    0 讨论(0)
  • 2020-12-09 12:14

    Your best bet may be the RCurl package. From the DESCRIPTION:

    [...] Additionally, the underlying implementation is robust and extensive, supporting FTP/FTPS/TFTP (uploads and downloads),

    Otherwise, rethink your problem. Maybe HTTP POST will do as well. It's not 1986 anymore so you're not required to use ftp.

    0 讨论(0)
  • 2020-12-09 12:26

    This should work:

    library(RCurl)
    ftpUpload("Localfile.html", "ftp://User:Password@FTPServer/Destination.html")
    

    Where Localfile.html is the file to be uploaded, User indicates the user name and Password the password to log into the server while FTPServer is a placeholder for the server name and possible path to use while last but not least Destination.html is an example of the name the to be uploaded file gets on the server.

    0 讨论(0)
提交回复
热议问题