ftp_nb_fget() function in PHP

The ftp_nb_fget() function downloads a file from the FTP server and saves it into an open file.

Syntax

ftp_nb_fget(con,open_file,server_file,transfer_mode,beg_pos);

Parameters

  • con − The FTP connection

  • open_file − The local data is stored here.

  • server_file − The server file to download.

  • transfer_mode − This is the transfer mode. The following are the possible values:

    - FTP_ASCII, or

    - FTP_BINARY

  • beg_pos − The position to begin the downloading

Return

The ftp_nb_fget() 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 −

Updated on: 2019-07-30T22:30:24+05:30

122 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements