I have been connecting to a ftp server for some time now, but it has stopped working this week.
The connection to the ftp works fine when accessing through FileZilla Client. But not when I try to go through R or internet explorer (both was working untill now). I have made sure that no firewalls are blocking the access.
I am using the Rcurl, getUrl functions to retrieve the data.
When I compare the output in R with the output log from Filezilla, I can see that both succeed in logging in, then run the PASV command. But since the PASV is diabled, filezilla manage to run the PORT command and collect the data.
From Filezilla log: 2017-08-07 13:57:02 2372 1 Command: PASV 2017-08-07 13:57:02 2372 1 Response: 500 PASV command is disabled. Use PORT command. 2017-08-07 13:57:02 2372 1 Command: PORT 10,45,9,89,222,62 2017-08-07 13:57:02 2372 1 Response: 200 PORT command successful 2017-08-07 13:57:02 2372 1 Command: LIST 2017-08-07 13:57:02 2372 1 Response: 150 Opening ASCII data connection for ls /.
From R:
get url_data_grouped transactions
library(RCurl)
Loading required package: bitops
url2<-c("ftp://"user"@IP address") filenames<-getURL(url2, userpwd="user:pwd", ftp.use.epsv = FALSE, verbose=TRUE, dirlistonly = TRUE)
* Trying "IP"...
* Connected to "IP" ("IP") port 21 (#0)
< 220-This server is for private use only
< 220-If you do not have access to this server
< 220-Please disconnect now
< 220 Please enter your login name now.
> USER "user"
< 331 Password required for user
> PASS "Password"
< 230 User user logged in.
> PWD
< 257 "/" is current directory
* Entry path is '/'
> CWD PMA
* ftp_perform ends with SECONDARY: 0
< 250 "/PMA" is current directory.
> PASV
* Connect data stream passively
< 500 PASV command is disabled. Use PORT command.
* Bad PASV/EPSV response: 500
* Remembering we are in dir "PMA/"
* Connection #0 to host "IP" left intact
Error in function (type, msg, asError = TRUE) :
Bad PASV/EPSV response: 500
Has anyone got good inputs for this issue?