Hi
You could create a page which intercepts the call and updates your DB and then send the file to the user
Example:
Your file with the links to files should looks like this:
<body>
<!-- Your links should link to the php page and have as parameter the file the user wants to download.
-->
<a href="download.php?file=filepath/filename.ext">File name</a>
</body>
The download.php page should be like this:
<?php
// insert into DB whatever you want
// After insert we send the file to the user using the Header function
Header("Location: $file");
?>
Hope this helps you out. If you have further questions mail or write here in the forum.