Welcome to WebmasterWorld Guest from 54.167.82.170

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

How to inflate a GZIP in perl

At my provider no mod_gunzip available

     

jetteroheller

8:27 pm on Mar 30, 2009 (gmt 0)

WebmasterWorld Senior Member jetteroheller is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Since at my content provider, mod_gunzip is not available,
I have to simulate the most important part myself.

use Compress::Zlib;

my $buffer = sub_to_laod_a_file ( "gzip compressed file" );

my $out = uncompress ( $buffer );

$buffer contains the compressed file,
but $out has 0 byte length.

What's wrong?

phranque

4:12 am on Mar 31, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



if $out contains no content it is undefined which means an error occurred:
COMPRESS/UNCOMPRESS [search.cpan.org]

these methods are intended for ZLIB Compressed Data Format Specification [ietf.org] (RFC-1950) and you probably want something that works for GZIP file format specification [ietf.org] (RFC-1952).

GZIP INTERFACE [search.cpan.org]:
Compress::Zlib::memGunzip [search.cpan.org]

try using this instead;

$out = Compress::Zlib::memGunzip($buffer) ;

jetteroheller

6:30 am on Mar 31, 2009 (gmt 0)

WebmasterWorld Senior Member jetteroheller is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Thanks! That works!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month