homepage Welcome to WebmasterWorld Guest from 54.226.235.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
How to inflate a GZIP in perl
At my provider no mod_gunzip available
jetteroheller




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

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




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

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




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

Thanks! That works!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved