From: Brian Candler Date: 2002-11-14T08:37:31+09:00 Subject: Re: File Packing Ideas On Wed, Nov 13, 2002 at 04:23:15AM +0900, Vera, Michael wrote: > I am testing the CGI solution now, and it may do the trick. Better would > even be bzipped data. > > I essentially get one shot to pass a complete file to a remote socket > connection, and want to do it in the neatest, most reliable, and even > smallest, fashion. > > All ideas will be considered :) As I said I tried various pack, gsub, > Marshall ways, but am not totally satisfied yet. How about open, write, close? TCP sockets are 8-bit clean. "Cleaner" (in the sense of more standardised, better control, ability to do authentication etc) would be to use a HTTP POST. The far end could then be just a webserver. If you want the semantics of a "file transfer" then you could use FTP. There are built-in Ruby libraries for HTTP and FTP. Regards, Brian.