Guide 19 - Identify who downloads a file |
6/18/2021 5:26:32 PM |
PHPRunner Tips and Tricks | |
fhumanes author
This example arises because one of the developers with phprunner wishes to identify who and when the files of an application are downloaded. As we all know, by default, phprunner shows the files that have previously been loaded and offers a link to download it. This situation is very powerful and almost always is preferred but sometimes it may interest us to know when and who has downloaded the files. Objective Show files associated with a record without the download link and clicking, registering the download and sending email to the system administrator. DEMO: https://fhumanes.com/download Test users: admin/admin To download the example, access my portal. For any questions, contact me in my email fernandohumanes@gmail.com |
|
fhumanes author 6/18/2021 | |
Technical solution The example is very simple and for any expert developer, it has very little to learn with him, but as novice developers may still have, some concepts may be applied to their projects. Pressing on the field, it appears: $fileArray = my_json_decode($value); To register download and send email I used the Process record ralues event, with this code: // Insert table Trace I attached the project and the backup of the sample database, so that you can install them on your PCs. I remember that you do not provide you with the file directory of the example, so you will have to give new records high with the "admin" user. |