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.