In PHP, ftp_nb_continue() continues a non-blocking FTP transfer that you started with ftp_nb_get(), ftp_nb_put(), ftp_nb_fget() or ftp_nb_fput().
A non-blocking transfer does not finish in one call. It sends a small chunk and returns, so your script can do other work in between. You keep calling ftp_nb_continue() until it says the transfer is done or has failed.
Syntax
Call ftp_nb_continue() with the values you need. Start with this line.
PHP
$status = ftp_nb_continue($ftp);
Call
What it does
ftp_nb_continue($ftp)
Sends or receives the next chunk and returns the current status.
while (ftp_nb_continue($ftp) === FTP_MOREDATA) {}
Keeps going until the transfer is no longer in progress.
$status === FTP_FINISHED
Checks that the whole transfer completed successfully.
It returns one of three constants: FTP_MOREDATA (still working, call again), FTP_FINISHED (done) or FTP_FAILED (something went wrong). Only one non-blocking transfer can run on a connection at a time.
Library declarations
PHP
ftp_nb_continue(FTP\Connection $ftp): int
Parameters
Parameter
Description
ftp
Required. The FTP\Connection object that has an unfinished non-blocking transfer.
Return Value
Return Value
Description
int
FTP_MOREDATA while the transfer is in progress, FTP_FINISHED when it is complete, or FTP_FAILED on error.
PHP Examples
Example 1 — Finish a Non-Blocking Download
Start a download with ftp_nb_get() and keep calling ftp_nb_continue() until it ends.