How to know if a file has been viewed

Asked

Viewed 664 times

0

I’m making a system in php where the counter sends a file to the client (using database). My question is the following, how to do 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 update a field I have in the database with the name of "data_visualization" putting the current date through the sql function "CURRENT_TIMESTAMP " and insert 1 in the field archival. So on the page where the saved documents are listed, I make a condition: if archive is equal to 0, then I highlight the file title so that the user knows that that file has not yet been viewed.

  • You can create a kind of file view log, post more details, post your code, what you’ve tried?

1 answer

3

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

What you could do would be to exchange the file and its opening/download.

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

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

If it is 1 (one) or another positive value, the document was received and, also based on the date you have 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.