1024) { $bandwidth = round($bandwidth / 1024 , 2); $bandwidth .= " MB"; } else { $bandwidth .= " KB"; } switch (@$_GET['download']) { case 'resume_speed': case 'noresume_speed': case 'resume': case 'noresume': $object->set_byfile($FILENAME); if ($_GET['download'] == 'noresume' || $_GET['download'] == 'noresume_speed') $object->use_resume = false; if ($_GET['download'] == 'resume_speed' || $_GET['download'] == 'noresume_speed' ) $object->speed = 100; $object->download(); break; case 'data': case 'dataresume': $data = implode('' , file($FILENAME)); $object->set_bydata($data); if ($_SERVER['download'] != 'dataresume') $object->use_resume = false; $object->filename = basename($FILENAME); $object->download(); break; case 'auth': $object->set_byfile($FILENAME); $object->use_auth = true; $object->handler['auth'] = "test_auth"; $object->download(); break; case 'url': $object->set_byurl('2017/PROPHILEO2016-2017_BD.pdf'); $object->download(); break; } if ($object->bandwidth > 0) { error_reporting(E_NONE); $b = intval(implode('',file('bandwidth.txt'))) + $object->bandwidth; $f = fopen('bandwidth.txt','wb'); fwrite($f,$b); fclose($f); exit; } function test_auth($user,$pass) { //test authentication function if ($user == 'user' && $pass == 'pass') return true; return false; } ?> HTTPDownload example

HttpDownload

Select a link and try it with a download manager (like Reget) .

Total bandwidth used :

Download file
Download file (speed limit 100 kbs)
Download file with resume
Download file with resume (speed limit 100 kbs)
Download file data (May slow)
Download file data with resume (May slow)
Authentication download (user/pass)
URL Download (simple redirect)