0

Hey I am using curl to download image files, but It can only download a maxium of 21 images after that I get the maxium execution time error.

$rh = fopen($imagelink, 'rb');
        $wh = fopen($imagepath, 'w+b');
        if (!$rh || !$wh) {
            echo 'error';;
        }
        while (!feof($rh)) {
            if (fwrite($wh, fread($rh, 4096)) === FALSE) {
            return false;
        }
        echo ' ';
        flush();
        }
        fclose($rh);
        fclose($wh);

i got this code from stackoverflow.

Hey it was my fault i was use a random and md5 function, and it did not generate more thant 21 random numbers.

1 Answer 1

0

use set_time_limit ( 0 ); so that it won't timeout

1
  • I have tried this, but its not downloading more than 21 files into that folder, like if i delete 3 files then it will download 3 more files but it wont have more than 21 files.
    – James King
    Jul 26, 2011 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.