Hi All,
I need a little help from you guys for a file download. I need to let my site users download a document file.
A user is provided with a link to download the file. However every time a user downloads a file, I need to log his IP address to a database. How can this be achieved seamlessly with any page refreshes etc. After logging the IP, can I change the file header to doc and populate the file with the contents with my document file ? What program construct do I need to use to copy the content from the original document file to the dynamically created file ? I would be very grateful for any information or pointer to an online article.
Thanks,
- Alec
Logging a file download
Moderator: General Moderators
Re: Logging a file download
It seems to me the easiest thing to do would be to log their IP once they click some kind of link (ie use some javascript or ajax). Otherwise you could setup a .php file that loads the document they're trying to download but adds the file they're downloading and their IP to your database table first.