On May 30, 2006, at 12:29 AM, Yochen Gutmann wrote:

> open("http://www.somewebpage.com/atestfile.pdf){|u|
>    targetFile = File.new("test.pdf,"w")
>    u.each_byte {|ch|
>      targetFile.putc ch
>    }
> }

Try:

open("http://www.somewebpage.com/atestfile.pdf", 'rb'){|u|
    File.open("test.pdf", "wb") do |f|
      f.write(u.read)
    end
}

-- Daniel