Forum: Ruby on Rails Creating a ZIP archive purely in memory?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bce1d1b7c3ec7b577dcb42e254899e6b?d=identicon&s=25 michael (Guest)
on 2005-11-17 01:08
(Received via mailing list)
Has someone devised a way to create a ZIP archive purely in memory? I
know of rubyzip, but apparently it can only create an archive as a
file. That's not too bad, but if I can I'd prefer to do this in memory.

Michael

--
Michael Schuerig                      They tell you that the darkness
mailto:michael@schuerig.de                  Is a blessing in disguise
http://www.schuerig.de/michael/           --Janis Ian, From Me To You
6c27f78ab0eee78732ae54e8b8718b84?d=identicon&s=25 david.felstead (Guest)
on 2005-11-17 01:26
(Received via mailing list)
Out of curiosity, why?

If you want to work around it, you can mount a ramdisk and zip to a
file in that...  or perhaps look at FuseFS
(http://rubyforge.org/projects/fusefs/) if you want to roll your
own...

Alternatively you could just use ZLib, but I assume you want zip for a
reason...

Cheers!

-DF
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 jeremy (Guest)
on 2005-11-17 01:32
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 16, 2005, at 4:25 PM, David Felstead wrote:
> On 11/17/05, Michael Schuerig <michael@schuerig.de> wrote:
>> Has someone devised a way to create a ZIP archive purely in memory? I
>> know of rubyzip, but apparently it can only create an archive as a
>> file. That's not too bad, but if I can I'd prefer to do this in
>> memory.
> Out of curiosity, why?

I guess he's dynamically generating a zipfile for his users to download.

e.g. download all posts from the past month.

jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDe88TAQHALep9HFYRAnAqAKCXdX2GHMP3zhHJIvaoAJRwESMRDQCghqHF
jtogVZGjstVd2rQLiatrEOk=
=cafG
-----END PGP SIGNATURE-----
Bce1d1b7c3ec7b577dcb42e254899e6b?d=identicon&s=25 michael (Guest)
on 2005-11-17 02:18
(Received via mailing list)
On Thursday 17 November 2005 01:30, Jeremy Kemper wrote:
> download.
Exactly. Doing this in memory and then send_data'ing would just be more
convenient than creating a temporary file and using send_file on it.

Michael

--
Michael Schuerig                  There is no matrix,
mailto:michael@schuerig.de        only reality.
http://www.schuerig.de/michael/   --Lawrence Fishburn
29c59c18c39f1107553477038650e36e?d=identicon&s=25 Phil Lewis (Guest)
on 2006-12-12 09:51
Did anyone ever come up with a way of doing this (other than using
chilkats zip library)?

Thanks

P
D7c511ce5025d37b8c6bd9134e0f2bd9?d=identicon&s=25 Thorsten L (Guest)
on 2006-12-12 13:47
(Received via mailing list)
This topic is locked and can not be replied to.