mircobabini
8/1/2013 - 12:39 AM

Gunzip for TOO LARGE files.

Gunzip for TOO LARGE files.

<?
// http://stackoverflow.com/questions/1229571/unpack-large-files-with-gzip-in-php
function gunzip($srcName, $dstName) {
    $sfp = gzopen($srcName, "rb");
    $fp = fopen($dstName, "w");

    while ($string = gzread($sfp, 4096)) {
        fwrite($fp, $string, strlen($string));
    }
    gzclose($sfp);
    fclose($fp);
}