PHP 中的 ftp_nb_continue() 函数
programmingserver side programmingphp更新于 2025/5/26 5:52:17
ftp_nb_continue() 函数继续接收或向 FTP 服务器发送文件。这意味着下载继续。
语法
ftp_nb_continue(con);
参数
con − FTP 连接。
返回
ftp_nb_continue() 函数返回以下任意值 −
FTP_FAILED − 发送/接收失败
FTP_FINISHED −发送/接收已完成
FTP_MOREDATA − 发送/接收正在进行中
示例
以下是示例。其中,"new.txt"是本地文件,而服务器文件是"server.txt" −
<?php
$c = ftp_nb_get($ftp_conn, "new.txt", "server.txt", FTP_BINARY)
while ($c == FTP_MOREDATA) {
// 继续下载
echo "The file is downloading!";
$d = ftp_nb_continue($ftp_conn);
}
if ($s != FTP_FINISHED) {
echo "The file isn't downloading now!";
exit(1);
}
?>

