From: "phil.swenson@..." Date: 2006-11-17T00:10:50+09:00 Subject: Re: need to fetch a zip file from url and unzip it Isn't Zlib for gzip? I'm trying to access a zip file. To use ruby Zip for this, but I have a string, not a binary form the > > require 'open-uri' > > zipFile = open(URL).read code... not sure how to proceed. thanks, phil Paul Lutus wrote: > phil.swenson@gmail.com wrote: > > > I"m aware of: > > > > require 'open-uri' > > zipFile = open(URL).read > > > > but this pulls back a string... I need to pull back a zip file > > (binary). > > > > Any ideas? > > Well since you are trying to unzip a ZIP file, I suggest you read about the > Zlib::Inflate class in your documentation. > > Start here: > > http://www.ruby-doc.org/core/classes/Zlib/Inflate.html > > The above page shows this example: > > def inflate(string) > zstream = Zlib::Inflate.new > buf = zstream.inflate(string) > zstream.finish > zstream.close > buf > end > > -- > Paul Lutus > http://www.arachnoid.com