From: Yochen Gutmann Date: 2006-05-30T07:29:56+09:00 Subject: Saving a PDF locally Hi Ruby-folks, I am currently working on a small program, which saves copies of website locally to my harddisk. For normal html-pages this works as expected. But now I am struggeling with binary files such as PDFs. Here is my code: open("http://www.somewebpage.com/atestfile.pdf){|u| targetFile = File.new("test.pdf,"w") u.each_byte {|ch| targetFile.putc ch } } The resulting local file cannot be opened with my pdf-reader. When I open it in an editor, there seems only to be numbers in the file (->not binary). instead of putc if tried write which did not work, too. Any hints? Yochen -- Posted via http://www.ruby-forum.com/.