In 2.5 a Microflow activity will be added which instructs the client to download a given file. Using this activity you can effectively count the number of downloads.
Example: create a button 'download this file' and let this button point to a Microflow. In this Microflow increase the number of downloads and execute a download activity.
You have to wait for the 2.5 release. In 2.4 it is not possible to instruct the client to download a file from a custom Java action. In 2.4 you should do it with the answer of Bas.
There is no real way to check if a download has succeeded, but this should be workable:
You could implement an object with a 1 to 1 relationship with the file object and add an integer named Count to this object.
When you have a datagrid with these files and a button to open a dataview to download them, implement a microflow that opens the dataview. Before opening this view, also raise the Count field by 1.
You have to wait for the 2.5 release. It is not possible to instruct the client to download a file from a custom Java action. In 2.4 you should do it with the answer of Bas.
This is currently not possible, but would be a nice feature request. Maybe the server can count the number of downloads. Or a better idea might be to have a "file download" action in microflows so you can manage the number of downloads yourself.
Would it be possible to trigger a microflow (with a custom download-action) that downloads the file and raises the number with 1?
Ok that sounds good, but do I need to wait for 2.5 or can I write a custom action in the meantime?