Goran Bogdanovic - 2010-12-24 11:44:47
I write this days curl based PHP class that handle direct and remote uploads/downloads http, https, ftp, ftps in all possible variations. I almost finish but I have just one problem direct download I manage to implement byte serving, ranges, resume download, speed limit... Only thing I do not know how to resolve is DOWNLOAD MANAGERS. What is problem when I use download manager let's say FlashGET he opens 1th connection and do not send Range header so class resolve it as regular download in all other connections he send one range eg bytes=111112- so class see it as one range, not multi range download, so I can not use header("Content-Type: multipart/x-byteranges")
That leads that at last everything is working but I have speed limit problem.
Every connection have speed limit let's say 50 KB/s so final limit is 5x50 and that is 250KB/s.
I do not have clue how to solve that. One idea is to collect headers and time and if connections are made in 2 seconds to reduce speed limit. Other solutions could be over Apache but not practical.
Any help would be great. Curl use CURLOPT_WRITEFUNCTION and callback fr download serving, and CURLOPT_RANGE for range downloads.
Thanks in advance Merry Cristmas and Happy New year.