因此,我运行了一个脚本,最终的数据帧称为sandwich
。最后,它将创建一个CSV文件,如下所示:
currentDate <- Sys.Date()
csvTest <- paste("/Users/joesmith/test_file_", currentDate,".csv",sep="")
write.csv(sandwich, file = csvTest, row.names = FALSE)
这将在本地文件夹test_file_2018-07-17.csv
中创建一个名为/Users/joesmith
的文件
但是对于下一步,我需要使用RCurl
包将其发送到FTP服务器。
为此,我编写了以下脚本:
library(RCurl)
ftpUpload(what = "test_file_2018-07-17.csv",
to = "ftp://ftp.infores.com/jsmith/Up/test_file_2018-07-17.csv",
verbose = TRUE,
userpwd = "jsmithftp:abc123xyz")
(注意:所有这些用户名,密码等都是伪造的,因此我不会发布任何机密信息或违反任何与安全性相关的内容)
但是当我运行它时,出现此错误:
TCP_NODELAY set
* Connected to ftp.infores.com (170.111.111.11) port 21 (#0)
< 220 Microsoft FTP Service
> USER jsmithftp
< 331 Password required for jsmithftp.
> PASS abc123xyz
< 230-Welcome to ftp.infores.com
< 230 User jsmithftp logged in.
> PWD
< 257 "/jsmithftp" is current directory.
* Entry path is '/jsmithftp'
> CWD jsmithftp
* ftp_perform ends with SECONDARY: 0
< 550 jsmith: The system cannot find the file specified.
* Server denied you to change to the given directory
* Connection #0 to host ftp.infores.com left intact
Error in function (type, msg, asError = TRUE) :
Server denied you to change to the given directory
有人知道我该如何解决或解决此问题吗?