サーバからファイルをダウンロードし、何か他のことをしながらダウンロードを続けます(非ブロッキング):
<?php
// initiate download
$d = ftp_nb_get($ftp_conn, "local.txt", "server.txt", FTP_BINARY)
while ($d == FTP_MOREDATA)
{
// do whatever you want
// continue downloading
$d = ftp_nb_continue($ftp_conn);
}
if ($d != FTP_FINISHED)
{
echo "Error downloading file.";
exit(1);
}
?>
ftp_nb_continue() 関数はFTPサーバにファイルの取得/送信を継続します。
ftp_nb_continue(ftp_connection);
| パラメータ | 説明 |
|---|---|
| ftp_connection | 必須。 使用するFTP接続を指定する |
| 返り値: | この関数は、次のいずれかの値を返します:
|
|---|---|
| PHP バージョン: | 4.3+ |