ftp_fget

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Downloads a file from the FTP server and saves to an open file
<?php ftp_fget(    FTP\Connection $ftp,    resource $stream,    string $remote_filename,    int $mode = FTP_BINARY,    int $offset = 0): bool
<?php     function ftp_fget(...$arguments)

    {

        if ( ! is_mocked('ftp_fget')) {

            return \ftp_fget(...$arguments);

        }



        return return_mocked_value('ftp_fget');
<?php     {

        $location = $this->prefixer->prefixPath($path);

        $stream = fopen('php://temp', 'w+b');

        $result = @ftp_fget($this->connection(), $stream, $location, $this->connectionOptions->transferMode());



        if ( ! $result) {

            fclose($stream);