How to tell if a file has been viewed

I am making a system in php where the counter sends a file to the client (using database). My doubt is the following, how to do so when the client accesses this file, is sent to the database the time and date it was opened.

I managed to solve.

I did the following, as soon as the user accesses the document (through the mode querystring), I do an update in a field that I have in the database with the name of "data_visualizao "putting the current date through the sql function" CURRENT_TIMESTAMP " and enter 1 in field lid_file . So on the page where the saved documents are listed, I make a condition: if file_lid equals 0, then I make a highlight in the file title so that the user knows that that file has not yet been viewed.

Author: Meeeefiu, 2014-06-02

1 answers

Control the exact moment the client opens a PDF I find impossible or at least so invasive that it should not even be considered.

What you could do would be intermingle the file and its opening/downloading.

Assuming you maintain a complete document input and output control in a database including the path of the physical file, with the old technique of querystrings (files.php?id = 123) you can send an email to the client with a link containing the ID of that file in your controls which, when accessed for download or viewing in the browser, you would use to update a field that serves as flag control.

In your dashboard, where you list The sent and received documents, you condition the value of that flag. If zero (DEFAULT) the document has not been read/received and, comparing with the date you have an automatic feedback that that customer needs a personal contact, why phone or email.

If it is 1 (one) or another positive value, the document has been received and also based on the date you have how to analyze the average time for a possible response.

However, again, this does not guarantee that the customer has read the content, but at least you know that there was a certain "interaction" between you.

 3
Author: Bruno Augusto, 2014-06-02 20:02:39