From: Konstantin Levinski Date: 2006-04-03T00:58:45+09:00 Subject: Re: sending files over a network If you know how to work with files, and how to set up connections (TCPServer/TCPSocket) you know enough to send a file over network with Ruby. Performance will be network-limited, so don't worry too much about it. You can use MD5/SHA1 for additional error checking, for error checking, tough TCP has this feature on its own. pseudocode ( as in - not tested but with a couple of fixes should probably work ) - sender: name="file.txt"; len = File.new(name).stat.size.to_s socket = TCPSocket.new('remote.host.org', 6666) socket.puts name socket.pits.len socket.write File.read(name) socket.close - reciever: socket = TCPServer.new('0.0.0.0', 6666).accept name = socket.gets len = socket.gets File.open(name, "wb") { | fl | fl.write (socket.read len.to_i ) } socket.close --- HTH