Recover Recycle Bin Delete file software PHP connection FTP implementation file upload, download, delete file instance code

Source: Internet
Author: User
PHP FTP transfer files to server

Copy the Code code as follows:


Begin
$ret = Ftp_nb_get ($my _connection, "test", "README", Ftp_binary,
FileSize ("test"));
Or: $ret = Ftp_nb_get ($my _connection, "test", "README",
Ftp_binary, Ftp_autoresume);
while ($ret = = Ftp_moredata) {
Other code can be inserted
echo ".";
Continue to transmit ...
$ret = ftp_nb_continue ($my _connection);
}
if ($ret! = ftp_finished) {
echo "Download error ...";
Exit (1);
}
?>


PHP FTP Delete files

Copy the Code code as follows:


$file = ' public_html/old.txt ';
Connecting to an FTP server
$conn _id = ftp_connect (' www.jb51.net ');
Verify user name and password
$login _result = Ftp_login ($conn _id, $ftp _user_name, $ftp _user_pass);
Delete the specified file
if (Ftp_delete ($conn _id, $file)) {
echo "$file file deletion succeeded N";
} else {
echo "Delete $file file failed n";
}
Close FTP connection
Ftp_close ($conn _id);
?>


PHP ftp Download file

Copy the Code code as follows:


$file = ' somefile.txt ';
Connecting to an FTP server
$conn _id = ftp_connect ($ftp _server);
Verify the user name and password www.jb51. Net
$login _result = Ftp_login ($conn _id, $ftp _user_name, $ftp _user_pass);
Gets the size of the specified file
$res = Ftp_size ($conn _id, $file);
if ($res! =-1) {
echo "$file file size is $res bytes";
} else {
echo "Failed to get remote file size";
}
Close FTP connection
Ftp_close ($conn _id);
?>

The above describes the recovery Recycle Bin delete file software PHP under the connection FTP implementation file upload, download, delete file instance code, including the recovery of the Recycle Bin deleted files software aspects, I hope that the PHP tutorial interested friends helpful.

  • 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.