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.
Parameter | Description |
---|---|
ftp_stream | The link identifier of the FTP connection |
local_file | The local file path (will be overwritten if the file already exists) |
remote_file | The remote file path |
mode | The transfer mode. Must be either FTP_ASCII or FTP_BINARY |
resumepos | The position in the remote file to start downloading from |
Returns TRUE on success or FALSE on failure.