I have a page with a list PDFs which can be downloaded. Can I count how often a pdf was downloaded?
I tried to solve this problem like
PAGE:
<apex:actionFunction name="redirect" action="{!Stats_In}"/>
<apex:outputLink value="{!URLFOR($Action.Attachment.Download, MSL2.Id)}" onclick="redirect(); return false"> TEST
<apex:param assignTo="{!DL_Item}" value="{!MSL.berschrift__c}"/>
</apex:outputLink>
CLASS:
public PageReference Stats_In() {
Stats__c sta = new Stats__c();
sta.Item__c = DL_item;
INSERT sta;
RETURN NULL;
}
But If I click at the link the click information will be stored but the download doesn't start. The DL_Item name is not stored in the information.