(PHP 4 >= 4.3.0, PHP 5, PHP 7)
ftp_nb_put — 存储一个文件至 FTP 服务器(non-blocking)
$ftp_stream
     , string $remote_file
     , string $local_file
     , int $mode
     [, int $startpos
    ] ) : int
     ftp_nb_put() 函数用来把本地文件 local_file
     存储到 FTP 服务器上由 remote_file 参数指定的路径。传输模式参数
     mode 只能为 FTP_ASCII (文本模式) 或 FTP_BINARY
     (二进制模式) 两种。与函数 ftp_put()
     不同的是,此函数上传文件的时候采用的是异步传输模式,也就意味着在文件传送的过程中,你的程序可以继续干其它的事情。
    
     返回 FTP_FAILED,FTP_FINISHED
     或 FTP_MOREDATA。
    
Example #1 ftp_nb_put() 实例
<?php
// 开始上传
$ret = ftp_nb_put($my_connection, "test.remote", "test.local", FTP_BINARY);
while ($ret == FTP_MOREDATA) {
   // 在这里可以加入其它代码
   echo ".";
   // 继续传送...
   $ret = ftp_nb_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
   echo "上传文件中发生错误...";
   exit(1);
}
?>
Example #2 使用 ftp_nb_put() 来断线续传
<?php
// 开始
$ret = ftp_nb_put ($my_connection, "test.remote", "test.local",
                      FTP_BINARY, ftp_size("test.remote"));
// 或: $ret = ftp_nb_put ($my_connection, "test.remote", "test.local",
//                           FTP_BINARY, FTP_AUTORESUME);
while ($ret == FTP_MOREDATA) {
   // 加入其它要执行的代码
   echo ".";
   // 继续传送...
   $ret = ftp_nb_continue ($my_connection);
}
if ($ret != FTP_FINISHED) {
   echo "上传文件中发生错误...";
   exit(1);
}
?>