lamp - Best way to transparently log downloads? -


I have a personal project that has been online for a while. I keep the number of downloads from doing so:

  • When the user clicks on the download link, he hits a PHP script which writes in the information table.
  • After the data is written, the script returns the path of the actual file.
  • The user has the ability to save the file to your hard disk as if it is another download.

It has worked well for some time; However, it prevents users from being able to save the right-click> target ... because they will actually actually see download.php in "Save File" Will give "Dialog, in this way, is the only way to download the project left-click on the link.

I would like to improve the process so that a user can download the project using that method with which he / That's the most comfortable. So, what are some better ways to enter the transparent way without downloading a user in the way?

What is the price , the machine is a standard LAMP Therefore, there is no NAT option.

It is taken from, but different scripts It is also possible to use languages:

  & lt ;? php // We will output the PDF header ('content-type: app / pdf'); // it will be downloaded. Pdf header ('Content-dispute: attachment; file name = "downloaded PDF' '); // PDF source is in the original PDF readfile ('Original PDF'); ? & Gt;  

HTTP-Header Content-Disposition asks to save it as a download.

Another option is to regularly inspect your log files, such as using a script every day.


Comments