php ftp class
usage of the class - get a file
Usage Example - Send a file
Usage Example - how to test for completion
you can download it here

require("class.ftp.php"); //include library
$f=new PHP_FTP('ftp.somesite.com', 'username', 'password'); //specify
connect info
$f->get('html/test.txt', 'c:/php/ftp/blah.txt'); //yes, tested on Windows
$f->kill(); //optional destroy class method
?>
Usage Example - Send a file
require("class.ftp.php");
$f=new PHP_FTP('ftp.somesite.com', 'username', 'password', 21); //optional port as 4th arg
$f->send('c:/php/ftp/blah.txt', 'html/test.txt'); //yes, tested on Windows
$f->kill();
?>
Usage Example - how to test for completion
if(!$f->send('c:/php/ftp/blah.txt', 'html/test.txt')){
echo "File sent
successfully!";
}else{
echo "Error
sending file.";
}
?>
you can download it here
Comments