<?php // FTP server details $ftpHost = 'ftp.cluster011.hosting.ovh.net'; $ftpUsername = 'analogde'; $ftpPassword = 'rainbow'; // open an FTP connection $connId = ftp_connect($ftpHost) or die("Couldn't connect to $ftpHost"); // login to FTP server $ftpLogin = ftp_login($connId, $ftpUsername, $ftpPassword); echo $ftpLogin; // local & server file path $localFilePath = 'P1000119.JPG'; $remoteFilePath = 'www/P1000119.JPG'; // try to download a file from server if(ftp_get($connId, $localFilePath, $remoteFilePath, FTP_BINARY)){ echo "File transfer successful - $localFilePath"; }else{ echo "There was an error while downloading $localFilePath"; } // close the connection ftp_close($connId); ?>