Link to home
Start Free TrialLog in
Avatar of star6868
star6868

asked on

How to limit number connections of client (IDM...) with Download Resumable - PHP ?

I use this php script to support resumable download:

http://www.php.net/manual/en/function.fread.php

Some download programs (like IDM) can open 8-16 concurrent connections to download file.

Now, I want to limit number of concurrent connection (ex. 1,2,3...).
How to do this?

Thanks in advance!
Avatar of rstewar
rstewar

You could try using htaccess:

Text from http://www.bloghash.com/2006/11/beginners-guide-to-htaccess-file-with-examples-part-ii/ :

Limiting Number of simultaneous connections
To limit the number of simultaneous connections to a directory or your entire site, use the below line. If you place it in a directory other than the root directory, then it will limit the connections to that directory and its sub-directories only. Placing it in htaccess file of root directory will implement it for entire site.

Syntax:
MaxClients < number-of-connections>

Examples:
MaxClients 40
MaxClients 100

Avatar of star6868

ASKER

Thank rstewar, but I want to limit concurrent connection when user download files, in particular with that PHP script. (http://www.php.net/manual/en/function.fread.php)

I'm stil waiting solution :)
Help me please!
ASKER CERTIFIED SOLUTION
Avatar of star6868
star6868

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial