phasync
CurlResponse / getDownloadedBytes

Method

CurlResponse::getDownloadedBytes

Return the number of bytes downloaded so far, or null before cURL has reported any progress.

Description#

public CurlResponse::getDownloadedBytes(): ?int

Return values#

?int

Examples#

Example 1
$response = $client->get('https://example.com/big.iso');
$body     = $response->getBody();
while (!$body->eof()) {
    $body->read(65536);
    echo $response->getDownloadedBytes(), " of ", $response->getDownloadSize(), "\n";
}

See also#