B
B
Bur Ov2022-02-02 13:21:49
linux
Bur Ov, 2022-02-02 13:21:49

How to log a file download from the server via a direct link?

Good afternoon. The file is downloaded from the server via a direct link, is it possible to log these downloads? We need information from which ip the download was and how many times the file is downloaded. It is desirable to implement this somehow using a php script.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dr. Bacon, 2022-02-02
@burov0798

Analyze web server logs.

T
tempick, 2022-02-02
@tempick

For example, configure the server so that instead of directly accessing the file, a php script is accessed, which will give the desired file, and at the same time log it. On apache, this can be done using .htaccess, on nginx - in the config

A
alekssamos, 2022-02-03
@alekssamos

I most often met only through an intermediate script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question