For download counts you could save to database
$sql = "UPDATE `novels` SET `count`=`count`+1 WHERE `id`=".(int)$id;
Assuming you have a count column
For download size you should move filesize
out:
header("Content-Length: ".filesize($file));
This is for allowing browser to see progress, if you want to display it, it's same, you can store it in database
$sql = "UPDATE `novels` SET `size`=".filesize($file)." WHERE `id`=".(int)$id;
This should be set when you upload.
Remeber to escape your mysql queries because of vulnerability. For integers is simple as you can cast (int)
.