rubing Posted November 8, 2008 Share Posted November 8, 2008 I am downloading large files via php with libcurl. The range option does not seem to be working: $cp=curl_init($file); $fp=fopen ($g, "w"); curl_setopt ($cp, CURLOPT_FILE, $fp); curl_setopt ($cp, CURLOPT_HEADER ,0); curl_setopt($cp,CURLOPT_CONNECTTIMEOUT,20); curl_setopt($cp,CURLOPT_RANGE,0-3000000); curl_setopt($cp, CURLOPT_USERAGENT, $useragent); curl_setopt($cp, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($cp, CURLOPT_HTTPHEADER, $headers); curl_setopt($cp, CURLOPT_AUTOREFERER, true); curl_setopt($cp, CURLOPT_COOKIEJAR, "cookie.txt"); curl_setopt($cp, CURLOPT_COOKIEFILE, "cookie.txt"); curl_setopt($cp,CURLOPT_TIMEOUT,260); //lets download the mp3 directly for now if ($proxy!==FALSE) { curl_setopt($cp, CURLOPT_PROXY, $proxy); } curl_exec($cp); Running this script and I receive an error like this: Operation timed out after 260000 milliseconds with 4303905 out of 7709889 bytes received So, obiously its downloading more than the range I specified above. Quote Link to comment Share on other sites More sharing options...
seokochin Posted November 18, 2008 Share Posted November 18, 2008 It will be good if you can put whole code ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.