PHP emulation ftp File upload Instance _php tutorial

Source: Internet
Author: User
Tags ftp connection ftp file
$mymode = Ftp_ascii;
$delete = 0;
$local _dir = "/my_local_download_directory";
$host = "Ftp.yahoo.de";
$remote _dir = ".";
$anonymous = 0;
$user = "MyUserName";

Core code

Class Myftp {

var $connector;
var $getback;

Function Connect ($ftp _server, $uname, $passwd) {
Baut Grundlegende FTP Connection auf
$this->connector = @ftp_connect ($ftp _server);
$this->login_result = @ftp_login ($this->connector, "$uname", "$passwd");
if ((! $this->connector) | | (! $this->login_result))
{
echo "FTP Connection has failed! n ";
echo "Attempted to connect to $ftp _server for user $uname n";
Die
} else {
echo "Connected to $ftp _server, for user $uname n";
}
}

function Lastmodtime ($value) {
$getback = Ftp_mdtm ($this->connector, $value);
return $getback;
}

function Changedir ($targetdir) {
$getback = Ftp_chdir ($this->connector, $targetdir);
return $getback;
}
function Getdir () {
Liefert Directory Namen zur

http://www.bkjia.com/PHPjc/445006.html www.bkjia.com true http://www.bkjia.com/PHPjc/445006.html techarticle $mymode = ftp_ascii; $delete = 0; $local _dir =/my_local_download_directory; $host = ftp.yahoo.de; $remote _dir =.; $ano nymous= 0; $user = MyUserName; Core code class Myftp {var ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.