fget example

$tempfile   = wp_tempnam( $file );
        $temphandle = fopen( $tempfile, 'w+' );

        if ( ! $temphandle ) {
            unlink( $tempfile );
            return false;
        }

        mbstring_binary_safe_encoding();

        if ( ! $this->ftp->fget( $temphandle$file ) ) {
            fclose( $temphandle );
            unlink( $tempfile );

            reset_mbstring_encoding();

            return ''; // Blank document. File does exist, it's just blank.         }

        reset_mbstring_encoding();

        fseek( $temphandle, 0 ); // Skip back to the start of the file being written to.
Home | Imprint | This part of the site doesn't use cookies.