From: Aa Aa Date: 2008-05-03T10:19:58+09:00 Subject: Re: HTTPClient download binary file Thanks works ok now. Since the b parameter is DOS\Windows only, would that throw an exception on a non windows OS? Heesob Park wrote: > Hi, > > Aa Aa wrote: >> Hi, >> >> I'm writing a simple program which downloads a resource from the >> internet. When I save a file to disk, it always ends up a few bytes >> larger than it should be and is thus recognized as a damaged file. >> >> The code I'm using: >> >> require 'httpclient' >> client = HTTPClient.new(nil) >> my_file = File.new("x:\\temp\\logo2.gif", "w") > try with: > my_file = File.new("x:\\temp\\logo2.gif", "wb") -- Posted via http://www.ruby-forum.com/.