Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP ftp_nb_fget() Function

PHP ftp_nb_fget() Function


PHP FTP Reference Manual Complete PHP FTP Reference Manual


Definition and Usage

The ftp_nb_fget() function downloads a file from the FTP server and saves it to a local open file. (Non-blocking)

This function returns one of the following values:

Unlike ftp_fget(), this function retrieves the file asynchronously. This means your program can perform other operations while the file is downloading.

Syntax

ftp_nb_fget(ftp_connection,local,remote,mode,resume)

Parameters Description
ftp_connection Required. Specifies the FTP connection to use.
local Required. Specifies the local open file in which to save the content.
remote Required. Specifies the path of the file from which the content is copied.
mode Required. Specifies the transfer mode. Possible values:
  • FTP_ASCII
  • FTP_BINARY
  • | | resume | Optional. Specifies where in the remote file to start copying. Default is 0. |

    Example

    This example copies text from "source.txt" to "target.txt":


    PHP FTP Reference Manual Complete PHP FTP Reference Manual