This topic is locked

Log When Document is Viewed/Downloaded

10/14/2024 1:44:56 PM
PHPRunner General questions
C
copper21 author

Good Afternoon,

I have the need to log when a user clicks to view/download a file. I have a rather straighforward form that allows an administrator to upload up to 3 files or documents. When the form is saved, users get an email that advises them to look at the form data.

Users will later log into the application, go to the list page to view the documents. I would like to log the action of the user clicking the file to view/download it. I already have logging in place when the list page is viewed, but I would like to log when the user clicks to view/download each of the files.

Is there a way to accomplish this? I would like to log the date/time the file is clicked as well as other things like user's name, ip address, etc.

img alt

fhumanes 10/14/2024

Hello,

I have this example, which is not exactly what you ask, but it looks like it and may help you build your code.

https://fhumanes.com/blog/guias-desarrollo/guia-19-phprunner-identificar-quien-descarga-un-archivo/

Greetings,
fernando

C
copper21 author 10/14/2024

Fernando,

Thank you, I will take a look at to see if I can get to work.

C
copper21 author 10/14/2024

Fernando,

I looked at your example and tried to get it to work. I am using PHPR V11. I copied the code into View As "Custom" in the files field. When I run the app, The images for the files appear, but they are not "clickable". When I click the field/files, the pop-up does not appear. I have not been able to get past that to try the logging part of the code.

Your example is great, but it looks like it will not log individual clicks on the files?

I will keep looking around to see if I can get something to work.

Brian