It's surprising how difficult it is to locate a simple, concise response to this:
- I've got a file, foo.zip, on my small website
- So what can I actually do to discover the number of individuals have utilized this file?
- I possibly could use Tomcat calls if required
Update: Should you suggest writing a script, are you able to point me to some decent one?
The easiest way would most likely be rather than connecting straight to the file, connect to a script which batches a counter after which forwards towards the file under consideration.
Or you might parse the log file if you do not require the data in realtime.
cat /path/to/access.log | grep foo.zip | grep 200 | wc -l
In answer comment:
The log file also consists of bytes downloaded, but as another person stated, this might not reflect the right count if your user cancels the download around the client side.
Make use of the logs--each GET request the file is yet another download (unless of course the customer stopped the download partway through for whatever reason).
the download of the file is performed around the client side inside a separate thread, that the user can cancel, so there doesn't seem like reliable method to count 'full' downloads, only download attempts