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)