I need to remove a file from an FTP server using PHP. How to do this?
I need to remove a file from an FTP server using PHP. How to do this?
Your question is not very clear, but let's see if I can help you. The following code can be used to fetch a file from the FTP server.
$server = "endereco_do_servidor.com.br";
$FTP_HOST = "ftp.exemplo.com";
$FTP_USER = "usuario";
$FTP_PASS = "senha";
$cHandle = ftp_connect($FTP_HOST) or die("O Servidor não pode se conectar ao FTP");
$login_result = ftp_login($cHandle, $FTP_USER, $FTP_PASS) or die("O Servidor não pode logar-se no FTP!");
ftp_get($cHandle, "diretorio_destino/arquivo.ini", "diretorio_origem/arquivo.ini", FTP_BINARY);
More questions you can take at: link