Forum: NGINX post_action only when the download is completed

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2008-11-15 01:42
(Received via mailing list)
i have a problem with post_action on nginx.conf.
And sorry for my bad English  :)

User come to my page an start a download.
Now i have add the post_action and add the download_end.php
in the download_end.php i will count the download stats (write into
database).
That work very beautifully without any error.

The problem is now, when the user cancel the download
download_end.php will execute, but thats false!

Only when the download is realy completed, than i will open
download_end.php
but NOT when the user canceled the download!

Are there any tricks?

Thank you for your help

       location /files/ {
           internal;
           alias /home/files/;
           post_action /download-stop;
       }

       location /download-stop {
           fastcgi_pass 127.0.0.1:9000;
           fastcgi_param SCRIPT_FILENAME
/var/www/page/download_it_end.inc.php;
           fastcgi_param QUERY_STRING     file_id=$file_id; //thats ok!
           fastcgi_param   REMOTE_ADDR     $remote_addr;
       }
This topic is locked and can not be replied to.