From: Lex Williams Date: 2008-09-03T22:28:32+09:00 Subject: Re: downloading files Marcelo Barbudas wrote: > Hi, > > Which is the proper way to download a binary file? > > Trying: > open(temp_path,"w").write(open(http_path).read) > > returns truncated files > > Cheers, > M. here is a snippet that should work : require "rubygems" require "mechanize" agent = WWW::Mechanize.new agent.get(link_to_download).save_as("name_of_the_file") -- Posted via http://www.ruby-forum.com/.