<?php
$send_file = 'xxx.jpg'; // file for sending
$remote_file = 'yyy.jpg'; // destination file
$ftp_server = ""; // add server name
$ftp_user_name = ""; // add user name
$ftp_user_pass = ""; // add password
$dst_dir = ""; // add destination directory ( www/upload/ )
//include class
include ("class.FTP.php");
//class constructor
$ftp = new ftp($ftp_server,$ftp_user_name,$ftp_user_pass,$dst_dir);
// sending any file
// FTP_ASCII or FTP_BINARY
$err = $ftp->sendfile($remote_file, $send_file, "FTP_BINARY");
if (!$err) echo "No transfer !";
else echo "Transfer OK.";
?>
|