S
S
Sergey Sokolov2021-03-17 23:04:34
Nginx
Sergey Sokolov, 2021-03-17 23:04:34

How in NGINX to catch the moment when the client has finished downloading a large file?

A site visitor downloads a large file.

How to handle the end of the download on the server side without relying on the client?

For example, immediately upon completion of the download, open some internal URL, execute a PHP script.

How it's done when uploading large files to the server: the file is saved, and proxy-pass at this location body off;only calls the php script when the large file is fully received. Something like this, but with the return of files.

So far, nothing has come to mind except directing syslog logging in this location to a socket that is listening to a constantly running PHP process, I have not tried it yet.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2021-03-18
@sergiks

ok google: nginx post action

A
Alexander Aksentiev, 2021-03-18
@Sanasol

Videos that the customer downloads 1 time are rendered, and they can be deleted.

According to the classics, you hammer nails with a microscope.
This is usually implemented on the back end, and not with such crutch complex methods.
One-time links on the backend and it counts them as downloads if necessary, and then, for example, delete files using links that have been downloaded at least once by cron.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question