Upload count - Since you have records going into the database for every upload, you can just do a:
to figure out how many records there are in the table.
To count the downloads, create a column in your table called "downloads". Initially this should be set to 0.
Now, whenever a file is requested, just do something like...
it's pretty straight forward.