php 使用 ftp_nb_put() 来断点续传

dafenqi
2023-08-09 / 0 评论 / 12 阅读 / 正在检测是否收录...

php 使用 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);
}
?>
0

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/testblog.58heshihu.com/var/Widget/Archive.php on line 1032

评论 (0)

取消