ftp_nb_continue() function in PHP


The ftp_nb_continue() function continues to receive or send a file to the FTP server. That means the download continues.

Syntax

ftp_nb_continue(con);

Parameters

  • con − The FTP connection.

Return

The ftp_nb_continue() function returns any of the following values −

  • FTP_FAILED − send/receive failed

  • FTP_FINISHED − send/receive completed

  • FTP_MOREDATA − send/receive in progress

Example

The following is an example. Here., “new.txt” is a local file, whereas server file is “server.txt” −

<?php
   $c = ftp_nb_get($ftp_conn, "new.txt", "server.txt", FTP_BINARY)
   while ($c == FTP_MOREDATA) {
      // downloading continues
      echo "The file is downloading!";
      $d = ftp_nb_continue($ftp_conn);
   }
   if ($s != FTP_FINISHED) {
      echo "The file isn't downloading now!";
      exit(1);
   }
?>

Updated on: 30-Jul-2019

25 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements