Javatpoint Logo
Javatpoint Logo

PHP ftp_get( ) Function

The ftp_get() function is used to download a file from the FTP server. The ftp_get() function retrieves a remote file from the FTP server, and saves it into a local file. This function was introduced in PHP 4.

Syntax:

Parameter Description Is compulsory
ftp_stream The link identifier of the FTP connection. compulsory
local_file The local file path(will be overwritten if the file already exists). 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_get() function returns true on success or false on failure.

Example 1

Explanation

In the above example, by using ftp_get() function we can download a file from ftp server to local file.

Example 2

Explanation

In the above example, by using ftp_get() we can download the file from FTP server and saves into local space.

Example 3

Explanation

In the above example, by using ftp_get() function we can download the file from FTP server and saves into local file.


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