PHP Classes
elePHPant
Icontem

PHP FTP

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      PHP FTP  >  All threads  >  PHP FTP  >  (Un) Subscribe thread alerts  
Subject:PHP FTP
Summary:Examples of how to use this class
Messages:5
Author:Phil Martin
Date:2006-06-19 07:27:00
Update:2009-02-17 04:19:17
 

  1. PHP FTP   Reply   Report abuse  
Picture of Phil Martin Phil Martin - 2006-06-19 07:27:00
Can you please provide some examples of how to use this class?

  2. Re: PHP FTP   Reply   Report abuse  
Picture of Erwin Kooi Erwin Kooi - 2006-06-19 07:52:58 - In reply to message 1 from Phil Martin
Sure, I just posted an example script as an extra file to this class.
In short, look at this snippet:

require_once "ftp.class.php";
$ftp =& new FTP();
if ($ftp->connect($ftp_server)) {
if ($ftp->login($ftp_user,$ftp_passwd)) {
$ftp->mkdir("ftp_test");
$ftp->chmod(777,"ftp_test");
$ftp->rename("ftp_test","ftp__test");
$ftp->rename("ftp__test","ftp_test");
$ftp->chdir("ftp_test");
$ftp->put("logo.gif","logo.gif");
$ftp->delete("logo.gif");
$ftp->cdup();
$ftp->rmdir("ftp_test");
} else {
echo "login failed: ";
print_r($ftp->error_no);
print_r($ftp->error_msg);
}
$ftp->disconnect();
print_r($ftp->lastLines);
} else {
echo "connection failed: ";
print_r($ftp->error_no);
print_r($ftp->error_msg);
}

  3. Re: PHP FTP   Reply   Report abuse  
Picture of Phil Martin Phil Martin - 2006-06-19 13:15:42 - In reply to message 2 from Erwin Kooi
Thanks Erwin.

  4. Re: PHP FTP   Reply   Report abuse  
Picture of mohammad mohammad - 2007-02-10 11:18:26 - In reply to message 3 from Phil Martin
tanks ervin

  5. Re: PHP FTP   Reply   Report abuse  
Picture of Constantin TOVISI Constantin TOVISI - 2009-02-17 04:19:17 - In reply to message 2 from Erwin Kooi
Hi Erwin,

First of all let me congratulate you for the wonderful work you made with this class. It is really amazing how easy all the FTP operations become all of a sudden.

What I want to ask you is if the class supports SFTP connections and how to work with that, and if it doesn't, are you aware of that would it involve to implement something like that to this already amazing class?

Thank you in advance for your time,
Constantin TOVISI