简体   繁体   中英

RCurl::ftpUpload() unspecified error: "Error in function (type, msg, asError = TRUE) : "

I am getting an odd, empty error when trying to use RCurl::ftpUpload() :

RCurl::ftpUpload(what = "test.txt",
                 asText = FALSE,
                 to = "sftp://myserver.com/uploads/test.txt",
                 port =2222,
                 userpwd = "user:pass",
                 connecttimeout = 30)

Error in function (type, msg, asError = TRUE) :

I have checked that I can make a connection to the server on that port (ie that it isn't firewalled) and I can, so I don't think that is the issue.

I'm not sure how to proceed since there isn't any actual error information.

It does look like the sftp protocol is available:

RCurl::curlVersion()$protocols
[1] "dict" "file" "ftp" "ftps" "gopher" "http" "https" "imap" "imaps" "ldap" "ldaps" "pop3" "pop3s" "rtmp" "rtsp" "scp" "sftp" "smb" "smbs" "smtp" "smtps" "telnet" "tftp"

Adding ssl arguments to avoid verification should do the trick:

RCurl::ftpUpload(what = "test.txt",
                 asText = FALSE,
                 to = "sftp://myserver.com/uploads/test.txt",
                 port =2222,
                 userpwd = "user:pass",
                 connecttimeout = 30,
                 ssl.verifypeer = FALSE, 
                 ssl.verifyhost = FALSE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM