We would like to track if a user has downloaded a file completely from our website. How do I know for sure that the user has downloaded this file fully without any issues. How should I go about designing this?

Our application is a j2ee app (richfaces, jboss, mysql) and the downloadable files will be served either from the database or from the file system.

What language? What platform? Can you add details that will be useful for those that want to answer?
–
Oded♦Sep 9 '11 at 13:38

Its a web application built using java technologies and the data itself might be fetched from a database or a file system
–
JoeSep 9 '11 at 13:51

'web application built using java technologies' is still very vague. Makes it hard for anybody to answer your question meaningfully. Also, if you provide more information, its better to edit the question than to post a comment below.
–
ArjunShankarSep 9 '11 at 14:18

@submachine - Let me know if its still not clear
–
JoeSep 9 '11 at 14:36

1 Answer
1

The fact that you served last byte to the client tells you nothing. Consider the following scenarios

A proxy (set of proxies) are in between your server and the client. When you successfully closed connection on your side, it only means that the file reached first proxy in the chain

With any reasonable scale you would need to use a CDN network to deliver your files, when you push a file to CDN that is the end of your tracking, now you can only rely on CDN generic stats they provide to you

Some event happens on the client side after you successfully delivered last byte (browser close, browser crush, disk error) that effectively means that the client can't see the file

What you might want to do is to devise some additional step that needs to happen intermediately after the file is successfully downloaded. Then you track that step. This has to be tied to your product and will vary wildly depending on the files types that you serve and business model. Some examples:

for large files, consider serving a "downloader software" first which then fetch the needed file. In case of any interruption it will resume the transfer (value for the user) and report to you (value to you)

for small executable files - let installer ping your server. Just a simple http GET for a page that does not exist. Then you collect accesslogs on that server, you can wrap into a feedback page that installer launches after all is done. It's OK if users will close it without feedback, you just need to count