Search code examples
phpapache2ubuntu-server

Tracking file complete download


I have a file hosting site and users earn a reward for downloads. So I wanted to know is there a way I can track whether the visitor downloaded whole file so that there are no fake partial downloads just for rewards.

Thank You.


Solution

  • If you could monitor the HTTP response codes returned by your web server and tie them back to the sessions that generated them, you would be in business.

    A response code of 206 shows that the system has delivered some of the information but not all of it. When the final chunk of the file goes out, it should not have a response code of 206.

    If you can tie this to user sessions by putting the session code inside the URL, then you could give points based on a simple log aggregation.