From: Paul Gilbert Date: 2010-08-30T18:11:46+09:00 Subject: Re: Downloading corrupted files Justin Collins wrote: > On 08/28/2010 02:44 AM, Paul Gilbert wrote: >> def download_to_folder(folder, replay_name,id) >> Dir.chdir("D:\\Starcraft\\Replays\\"+folder) >> writeout = open(replay_name, "w") >> writeout.write(open("http://www.sc2rep.com/replays/download?id="+id.to_s).read) >> writeout.close >> end >> >> Configuration (maybe it helps): Windows 7 64bit, Ruby 1.9.1-p243, >> Netbeans 6.8 with JRuby 1.8.7 (2009-11-04 patchlevel 174) [java] >> > Try it with open(replay_name, "wb") to open the file in binary mode. > > -Justin Wou, thanks a lot :) -- Posted via http://www.ruby-forum.com/.