How can i know how much data is written in php curl . Here is my code which downloads i.e writes the data to my local server from a remote url . But i want to know how much data has been written till now .
<?php
$url = 'https://speed.hetzner.de/1GB.bin';
$path = $_SERVER['DOCUMENT_ROOT'] . '/1gb.bin';
$fp = fopen($path, 'w');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);