Javatpoint Logo
Javatpoint Logo

PHP ftp_fget() Function

The ftp_fget() function is used to downloads a file from the FTP server and saves to an open file. This function was introduced in PHP 4.

Syntax:

Parameter Description Is compulsory
ftp_stream The link identifier of the FTP connection. compulsory
handle An open file pointer in which we store the data. compulsory
remote_file The remote file path. compulsory
mode The transfer mode. Must be either FTP_ASCII or FTP_BINARY compulsory
resumepos The position in the remote file to start downloading from Optional

Returns

The ftp_fget( ) function returns true on success or false on failure.

Example 1

Explanation

In the above example, by using ftp_fget() function we are downloading a file from the FTP server and saves to an open file.

Example 2

Explanation

In the above example, by using ftp_fget() function we are downloading the file from FTP server and saves on the given location.

Example 3

Explanation

In the above example, by using ftp_fget() function we are downloading the file from ftp server and save the file on the given location.


Next TopicPHP FTP





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA