I have a content type called "uploads" that includes a file field (each of these nodes only has an "attached" download.)
I have a view that shows only the date of publication of these nodes, with a link to the file to download (relation: field_upload file).
that is to say.
2019/01/31 what.pdf (related to / system / files / reports / w Whatever.pdf)
2019/02/02 any2.pdf (related to / system / files / reports / w Whatever2.pdf)
In the current state of things, this creates a direct link to the file in question (not the node) – but I would now like to know if the file was downloaded (well, at least if the link for the download was clicked.)
I've set up a Boolean field in this type of content uploads & # 39; (used for these files) called & # 39; downloaded & # 39 ;, I installed rules, VBO, etc. and I already use it to change other Boolean values elsewhere (when a node is updated, etc.)
What I'm trying to do is that this view (showing publication date / file pairs) has the file link:
- Start by triggering a rule to change the Boolean value to indicate that it has been downloaded / viewed.
- Download the file (probably by creating a link.)
I've failed for most of the day and I'm not sure of the best approach.
I suspect that there should be a way to use VBO with "individual buttons" instead of checkboxes to achieve my goal, but I do not see the way to trigger a download in the rules.
Alternatively, I can imagine that there is a way to execute php code and achieve these goals, but it's above my head, without any direction.
All suggestions are highly appreciated, and if I say too much here, the long story is:
"I need a file download link in the views that also changes a Boolean value when the user clicks on it."
Any help very appreciated!