Hi community, I'm try to make the same access of this server like I do with FileZilla program.
Is my first time with this topic and I want learn very well.
I'm working on updating multiple folders on a remote server. I have the credentials, and the connection works well in FileZilla. However, I want to implement a more efficient method to streamline this process and avoid manual steps for update images. For that I'm using curl
Rcurl
.
The FileZilla settings:
With library(curl)
library(curl)
ftp_url <- "ftp://ftp.genesys-pgr.org/wiews/COL003/acn/G21366"
username <- "m"
password <- "FTPpassword"
port <- 2222
#for list file
list_files_ftp <- function(url, user, pwd, timeout = 50) {
handle <- new_handle()
handle_setopt(handle,
userpwd = paste(user, pwd, sep = ":"),
use_ssl = 2, # CURLUSESSL_ALL
ssl_verifypeer = FALSE,
ssl_verifyhost = FALSE,
ftp_use_epsv = TRUE,
dirlistonly = TRUE,
timeout = timeout)
con <- curl(url, "r", handle = handle)
file_list <- readLines(con)
close(con)
return(file_list)
}
file_list <- list_files_ftp(ftp_url, username, password, timeout = 60)
## Error
# Error in open.connection(con, open = mode) :
# Timeout was reached: [ftp.genesys-pgr.org] Connection timeout after 10007 ms
# 6.open.connection(con, open = mode)
# 5.open(con, open = mode)
# 4.withCallingHandlers(open(con, open = mode), error = function(err) {
# close(con)
# })
# 3.curl_connection(url, open, handle)
# 2.curl(url, "r", handle = handle)
# 1.list_files_ftp(ftp_url, username, password, timeout = 60)
With library(Rcurl)
RCurl::getURL(url = "ftp://m:FTPpassword@ftp.genesys-pgr.org/wiews/COL003/acn/G21338/G21338 pod.jpg") # Im try with // and \\
The idea is get the connection for update the images files in each folder.
Tnks for any advice.