PHP ftp_nb_continue() 函数
PHP 教程
· 2019-01-26 09:43:16
定义和用法
ftp_nb_continue() 函数连续获取/发送文件。(无阻塞)
该函数返回下列值之一:
- FTP_FAILED(发送/获取失败)
- FTP_FINISHED(发送/获取成功)
- FTP_MOREDATA(发送/获取正在进行中)
该函数异步地发送/获取文件。这意味着您的程序可以在文件下载时执行其他操作。
语法
ftp_nb_continue(ftp_connection)
| 参数 | 描述 |
|---|---|
| ftp_connection | 必需。规定要使用的 FTP 连接。 |
实例
<?php
$source = "source.txt";
$target = fopen("target.txt", "w");
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
$status = ftp_nb_fget($conn,$source,$target,FTP_ASCII);
while ($status == FTP_MOREDATA)
{
$status = ftp_nb_continue($conn);
}
if ($status != FTP_FINISHED)
{
echo "Download error";
}
ftp_close($conn);
?>
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
Data Structures and Algorithms in Java
Robert Lafore / Sams / 2002-11-06 / USD 64.99
Data Structures and Algorithms in Java, Second Edition is designed to be easy to read and understand although the topic itself is complicated. Algorithms are the procedures that software programs use......一起来看看 《Data Structures and Algorithms in Java》 这本书的介绍吧!