Code for tracking file downloads.