Saturday, February 09, 2008

Rails Send Data Through a Pipe with IO.popen

While having trouble getting Unix zip to play nice with Ruby's Tempfile I found that it was much easier to just avoid a temp file altogether by using a pipe create with IO.popen. Example code below shows how you might zip up a directory and send it back to the user from a controller:

No comments:

Post a Comment