File "donwload.php"

Full Path: /home/analogde/www/Outlook/Fusion/FTP/donwload.php
File size: 740 bytes
MIME-type: text/x-php
Charset: utf-8

<?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);

?>