glenn-at-nasa
glenn-at-nasa

Reputation: 1

fread / ob_flush / flush failing on only one file

I have a PHP application running on the web that manually downloads large binary files that are not located in the web space filesystem.

    while(!feof($l_file_handle)) {
        print(fread($l_file_handle, 1024*8));
        ob_flush();
        flush();
    }

This always works fine except there is one file that always causes it stop and fail at around 64 MB into the file. I have tried different values for the fread length argument (e.g. using 8 instead of 1024*8) but to no avail. It seems like it gets tripped up whenever it encounters a certain segment of bytes in the file, and then fails in flush().

Has anyone else encountered something like this and could suggest something to try? Thanks!

If I use a length of 1024*8, I get error messages of AH01369: missing argument name for value to tag \xbd\x17\xc7

If I use a length of 8, it fails without those messages.

I also tried calling flush() before ob_flush(), but that didn't help.

Upvotes: 0

Views: 28

Answers (0)

Related Questions