Whenever I do web stuff I prefer using an external library. ie Mechanize

Here is what it'd look like with mechanize :

require 'Mechanize'
agent = Mechanize.new
file = agent.get('uri') #Returns a Mechanize::File object
file.save('filename')

You could also use blocks if you wanted.
That will save the file in the same directory as the script.

-- 
Posted via http://www.ruby-forum.com/.