Unzipping a file

Hi !

I’m attempting to write a simple gallery in Rails. The thing is I’d like
be able to upload a lot of pictures at once with a zip file.

I’ve so far managed to upload the zip file (containing pictures) to the
server. But how do I unzip the file to have access to the pictures ? I
haven’t been able to understand how to use Zlib to do this.

Any tips or ideas welcome, especially if you have a better way of
accomplishing what I’d like to do…

Best regards,

David S.

gem install rubyzip

Some example I found:

Zip::ZipFile::open(“all.zip”) { |zf|
zf.each { |e|
fpath = File.join(OUTDIR, e.name)
zf.extract(e, fpath)

Software that uses rubyzip so you can look at examples are amongst
other Mephisto

On 8/3/06, David S. [email protected] wrote:

accomplishing what I’d like to do…