I am currently developing a web application in which the user can download some files. However, I would like to limit the number of simultaneous downloads for the user. For example, if the user is currently downloading a file A, he can’t download another file until his download has been finished or he canceled his download.
I would like to be able to know when a download finished or when a user abort a download. I tried to implement this kind of “algorithm” (Limiting Parallel/Simultaneous Downloads – How to know if download was cancelled?) but it seems not work. The script doesn’t run on the destructor apparently.
So if you have any solution, I listen to you.
Thank you.
You can do this from your web server. If using apache try mod_limitipconn.c or for nginx try HttpLimitConnModule