Search code examples
rurldownloadftprcurl

Error accessing ftp with getURL in R


I want access files on the internet, but I get the following error message:

Error in function (type, msg, asError = TRUE)  : Access denied: 530
In addition: Warning messages:
1: In strsplit(str, "\\\r\\\n") : input string 1 is invalid in this locale

This is my code from this post:

library(RCurl)    
url<'ftp://ftp.address'
    userpwd <- "user:password"
filenames <- getURL(url, userpwd = userpwd,
                    ftp.use.epsv=FALSE, dirlistonly = TRUE)

Any idea how to solve this?

Thanks a lot for your help!


Solution

  • Try:

    library(RCurl)
    filenames <- getURL(url="ftp://user:[email protected]",ftp.use.epsv=FALSE, dirlistonly = FALSE)