I have a shortcode to extract info from a file using a URL when this is requested by code says that file is 410 MB, but when this file is fully downloaded real file size is 390 MB, some way of getting file size 390 MB or a bit similar to end size?
<?php
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
$data = curl_exec($ch);
$size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);
curl_close($ch);
echo round( $size / '1000000', 2);
?>
 
     
    