PHP ftp_get() Function

The ftp_get() function gets (downloads) a file from the FTP server, and saves it into a local file.

ftp_get — Downloads a file from the FTP server.

bool ftp_get ( resource $ftp_stream , string $local_file , string $remote_file [, int $mode = FTP_IMAGE [, int $resumepos = 0 ]] )

ftp_get() retrieves a remote file from the FTP server, and saves it into a local file.

Example -

ParameterDescription
ftp_streamThe link identifier of the FTP connection
local_fileThe local file path (will be overwritten if the file already exists)
remote_fileThe remote file path
modeThe transfer mode. Must be either FTP_ASCII or FTP_BINARY
resumeposThe position in the remote file to start downloading from

Returns TRUE on success or FALSE on failure.