download files counter... count downloaded only!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

download files counter... count downloaded only!!

Post by jmut »

Hi,
I decided to make a small counter of downloaded files. never did that before and found kind of a problem (no idea how these kind of counters are made generraly).

The idea is to provide the file for download through php file...so you can increase the counter. Just before giving the file for download ...counter is increased. When save as... dialog appears though, client can choose 'cancel'...so then this file is not really downloaded.

Is it possible to increase counter only when sure download is really made.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

AFAIK, no, because when cancel is chosen from that dialog box, nothing is sent to the server to acknowledge this. I doubt this can be tracked via client side scripting either.

I highly doubt any other website that uses a download counter accounts for the user clicking cancel after clicking the download link.
Post Reply