View Single Post
Old 02-13-2005, 04:56 PM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
You could try the code in the other thread. If that doesn't work, you could look in robot_functions.php and find:
Code:
    if (in_array($result_test['status'],array('MSWORD','MSEXCEL','PDF','MSPOWERPOINT'))) {
        $bin_file = 1;
        $file_content = array();
        $fp = fopen($uri,"rb");
        while (!feof($fp)) {
            $file_content[] = fread($fp,8192);
        }
        fclose($fp);
    }
    else {
        $bin_file = 0;
        $file_content = phpdigGetUrl($uri,$result_test['cookies']);
    }
And replace with:
Code:
    if (in_array($result_test['status'],array('MSWORD','MSEXCEL','PDF','MSPOWERPOINT'))) {
        $bin_file = 1;
        $file_content = array();
        $fp = fopen($uri,"rb");
        $oh_stop_me = 0;
        while (!feof($fp) && $oh_stop_me < XXXXX) {
            $file_content[] = fread($fp,8192);
            $oh_stop_me++;
        }
        fclose($fp);
    }
    else {
        $bin_file = 0;
        $file_content = phpdigGetUrl($uri,$result_test['cookies']);
    }
Where XXXXX is the number of iterations you want to go. Alternatively, you could modify the code to check for a size/length sum at each while-step and try to limit that way.

If you do this, you might run into a problem should a binary file get truncated in an inappropriate location, so you'd need to figure out how to define a 'correct' cut point.

I don't have any other ideas at the moment.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote