I want to find download time in PHP by sending a request to my MySQL server. I have one table with an href link to download the file. If I click download the download time shoul
if you need some code you should use filesize and you can evaluate the time to download by doing some calculation, you cannot know the exact time since it depend on the user speed and all the network between your server and the user.
$filesize = filesize($yourfile);
$time_for_modem = $filesize * 8 / (56*1024);
$time_for_adsl = $filesize * 8 / (5*1024*1024);
$time_for_t3 = $filesize * 8 / (44*1024*1024);
function convertSecondToTime($sec){
$hour = floor($sec/60)
return $hour . 'hours and ' . ($sec%60) . 'minutes';
}
The modem time is for a 56kbps connection, adsl a 5 mbps, T3 44 mbps connection.