From: Logan Capaldo Date: 2006-03-01T11:52:29+09:00 Subject: Re: Sending Binary Data? --Apple-Mail-11--359922324 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Feb 28, 2006, at 3:52 AM, Yacin Nadji wrote: > server = TCPSocket.new('localhost',9191) > file = String.new > IO.foreach("lighter.jpg") do |line| > file += line.chomp > end try deleting the .chomp. Jpg's aren't really line oriented anyway. Also if you are on windows not opening the file in binary mode will wreak also sorts of havoc. As an alternative try this: a = File.open("lighter.jpg", "rb") { |f| f.read } --Apple-Mail-11--359922324--