...

View Full Version : Download count



Stromgren
03-01-2012, 01:06 PM
Hello

I need to be able to count the number of downloads on different files on my site. Im currently counting views simply by incrementing a counter on each visit. But i have no idea where to count download since its just a simple <a> link to the file.

Any suggestions?

Thanks in advance :)

mlseim
03-01-2012, 01:23 PM
What type of files are they?

Stromgren
03-01-2012, 01:29 PM
What type of files are they?

They are .SLT files.. A 3D model type..

Keleth
03-01-2012, 03:19 PM
Instead of pointing straight to the file, point to a PHP (or w/e server side you're using) file that increases the download count, then forwards to the actual file. You can hash the filename of the download to avoid people going there directly.

Making a htaccess point all download file requests to a controller is another good way to do it (more or less the above, but more direct).

mlseim
03-01-2012, 04:07 PM
Adding to Keleth ...
You can keep track of counts using a MySQL database, or a simple method
of updating a count file ... either way, done with PHP. There might be a limit
issue, depending on how large those .slt files are (byte size). If security isn't
an issue (you don't care if the users know where the files are located), that
would make the whole process much easier. Hiding the URL adds some complexity.

Stromgren
03-01-2012, 04:16 PM
Thanks to both of you. Security is no problem here. I will try making the link point to another PHP file which counts and then redirects to the download.

Thanks a lot!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum