我在 R 中尝试从多个 FTP 服务器提取 csv 数据。到目前为止,我的代码在其中两台服务器上运行良好,并且我能够收集所需的数据,但第三台服务器抛出以下错误:
Error in function (type, msg, asError = TRUE) :
Failed to connect to ftp.ekeystone.com port 21 after 21191 ms: Timed out
这是我的代码:
# required packages
library(RCurl)
# credentials
url <- "ftp.ekeystone.com"
pwd <- "xxxxxxx:yyyyyyyy"
# recover raw files
rawFiles <- getURL(url = url, userpwd = pwd, ftp.use.epsv = FALSE)
它适用于
ftp://154.49.142.233
和 ftp.motorstateftp.com
,但不适用于 ftp.ekeystone.com
。
“需要通过 TLS 进行隐式 FTP” 就是问题所在。我没有看到您的代码中启用了 TLS,仅启用了隐式 TLS(使用端口 990)。
我不知道 RCurl。但我会从开始
url <- "ftps://ftp.ekeystone.com"