You mean you want to have your own download.php page that is like the one used by so many others? Here is one of mine:
header('Content-disposition: attachment;filename=file.js');
header('Content-type: text/javascript');
readfile($_SERVER['DOCUMENT_ROOT'] . '/_js/file.js');
That's pretty much it, this will let you download the file. You have to have the correct filename in readfile() and it usually helps to have the correct content type. There are many, so look up the right one depending upon the file type.
I don't know how to track whether the user actually downloaded the file .. probably have to look at the server logs or something. It would be very easy to track who got to the download.php page, though. Just have the page stored in your DB and write the number of times the page was viewed +1.
Here is a pretty nice list of at least some content-types you can use:
http://www.utoronto.ca/web/htmldocs/book/book-3ed/appb/mimetype.html