When using WinSCP I perform the following steps: (dummy data)
hostname: bala.rimunivert.com.br username: zzzzzzz @ rjozzz000
after that he asks Gateway username: juliohenrique Gateway password: 1234566
and after that still appears: futher authentical required and then I put another password: blablabalaba
That is what I understand to access this server I need to authenticate myself in another first. The question that generates me is the following, how to implement this in my code?
//esse é um metodo de conexao da minha classe ftp
public function connect ($server, $ftpUser, $ftpPassword, $isPassive = false){
// *** Set up basic connection
$this->connectionId = ftp_connect($server);
// *** Login with username and password
$loginResult = ftp_login($this->connectionId, $ftpUser, $ftpPassword);
// *** Sets passive mode on/off (default off)
ftp_pasv($this->connectionId, $isPassive);
// *** Check connection
if ((!$this->connectionId) || (!$loginResult)) {
$this->logMessage('FTP connection has failed!');
$this->logMessage('Attempted to connect to ' . $server . ' for user ' . $ftpUser, true);
return false;
} else {
$this->logMessage('Connected to ' . $server . ', for user ' . $ftpUser);
$this->loginOk = true;
return true;
}
}
//minhas constantes definidas
define('FTP_HOST', 'bala.rimunivert.com.br');
define('FTP_USER', 'juliohenrique');
define('FTP_PASS', '1234566');
//como eu chamo esse metodo e algum arquivo
$ftpObj -> connect(FTP_HOST, FTP_USER, FTP_PASS);
This code would work if I did not have to authenticate to another server before accessing the server I want. I do not know if it was clear, but can anyone help me how should I make this connection?
How can I connect to send files on this type of network?
** Guys, someone gives me a light! by winscp I connect marking the SFTP option, what does this mean?