From: Phillip Gawlowski Date: 2008-05-21T06:16:31+09:00 Subject: Re: Is it possible for rubyzip to return zipped data instead of writing it to the disk? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 szimek wrote: | Hi, | | I got simple Rails app and I'd like to compress xml data and send it | to the browser. I'm trying to use rubyzip for it, but i.e. the | following usage: | | Zip::ZipFile.open("file.zip", Zip::ZipFile::CREATE) do |zip| | zip.get_output_stream("file.xml") {|f| f.puts xml_data} | end | | returns nil and creates file on the disk. | | Is it possible for rubyzip to return zipped data (or file) instead of | writing it to the disk? Write file to disk, give user link, delete file after a time, in case the download has to be repeated. Caching saves CPU and memory. :) - -- Phillip Gawlowski Twitter: twitter.com/cynicalryan Blog: http://justarubyist.blogspot.com Write first in an easy-to-understand pseudo-language; then translate into whatever language you have to use. ~ - The Elements of Programming Style (Kernighan & Plaugher) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgzP6sACgkQbtAgaoJTgL8o4ACfcp/wTC7QT52nXFDre9I+YRck iBEAn1x/BtR99VLngUBmvOSmD3EN8mCk =L8uK -----END PGP SIGNATURE-----