Announcement

Collapse
No announcement yet.

How To Upload File Via FTP Using PHP Code?

Collapse

Ads on showthread pages

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How To Upload File Via FTP Using PHP Code?

    WordPress Hosting on SSD Servers
    Hello All,

    In order to upload file/s or folder/s on web server using PHP Code one can use below mentioned sample script:

    <?php
    require_once "PHPFTP.php";

    $ftp = new PHPFTP();

    $result = $ftp->Connect('www.yourdomain.com','login name','password');
    if ($result == 0)
    {
    $ftp->DoCommand('enter command here', $result_number, $result_text);
    echo "$result_text ($result_number)";
    $ftp->DoCommand('another command', $result_number, $result_text);
    echo "$result_text ($result_number)";
    $ftp->Disconnect();
    }
    ?>

    That's it!

    Thanks,

    Shane G.
    AccuWebHosting.Com
    Last edited by admin; 08-04-2015, 08:25 AM.
Working...
X
Sign up for a News Letter Click here to sign up