From: Robert Klemme Date: 2009-05-11T17:55:06+09:00 Subject: Re: File over tcp? with out using net/ftp 2009/5/11 Albert Schlef : > Bigmac Turdsplash wrote: >> i have tested with this and it works with text files but thats it... >> image files and executable's dont function after being sent threw the >> socket...you said i should open files in binary mode? how can i do this >> and then after words will the files function properly? > > You're probbaly using Windows. Instead of: > >> file = File.new('file.jpg') >> destFile = File.new('file-received.jpg', 'w') > > Do: > > file = File.new('file.jpg', 'b') > destFile = File.new('file-received.jpg', 'wb') I would do that regardless of platform for these reasons - documentation (immediately clear that this file is treated as binary), - portability of programs. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/