警告:<promise>中的错误:服务器拒绝您更改为闪亮的给定目录

时间:2018-06-30 09:23:12

标签: r shiny

我正在尝试连接到r中的ftp服务器,并希望下载文件。当我使用此代码脱机运行时,它将完全成功。

url = "ftp://user:pswd@000.000.0.00/folder_name"
filenames <- getURL(url,ftp.use.epsv = FALSE,dirlistonly = TRUE)
userpwd <- "user:password"


filenames = paste(url,"/", strsplit(filenames, "\r*\n")[[1]], sep = 
"") 
con = getCurlHandle( ftp.use.epsv = FALSE) 

download_ftp_file <- function(file_remote, file_output, credentials = 
"", 
                          curl = FALSE, verbose = FALSE, progress = 
"none") {

 # Check
if (!length(file_remote) == length(file_output))
 stop("Remote and output vectors need to be the same length...", call. 
= FALSE)

# Build mapping data frame
df_map <- data.frame(
file_remote = file_remote,
file_output = file_output,
stringsAsFactors = FALSE
)

# Do
plyr::a_ply(
 df_map, 
 1, 
 download_ftp_file_worker, 
 credentials, 
 curl,
 verbose, 
 .progress = progress
)

# No return

}

它成功,但是当我在闪亮的应用程序中使用相同的代码时,出现错误:

  

警告:错误:服务器拒绝您更改为给定的   目录

如何解决此问题,请帮助我...

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,最终导致我的ftp路径不正确。

我将ftp位置粘贴到firefox中,并返回找不到该地址的信息,我发现我缺少反斜杠。