<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// turn passive mode on
ftp_pasv($ftp_conn, true);
$local_file = "local.zip";
$server_file = "server.zip";
// download server file
if (ftp_get($ftp_conn, $local_file, $server_file, FTP_ASCII))
{
echo "Successfully written to $local_file.";
}
else
{
echo "Error downloading $server_file.";
}
// close connection
ftp_close($ftp_conn);
?>
Thankx a lot Megha for your Feedback.I am very pleased to hear that you are getting something valuable in my blog.
ReplyDelete