<?php

require __DIR__ . '/vendor/autoload.php';

use GuzzleHttp\Client;

$url = "https://domain.tld/large-file.mp4";

$tmpFile = tempnam(sys_get_temp_dir(), 'guzzle-download');
$client = new Client(array(
    'base_uri' => '',
    'verify' => false,
    'sink' => $tmpFile,
    'curl.options' => array(
        'CURLOPT_RETURNTRANSFER' => true,
        'CURLOPT_FILE' => $handle
    )
));

$res = $client->get($url);
echo $res->getStatusCode() . "\n";
echo $res->getHeaderLine('content-type') . "\n";