From: Andrew Date: 2003-04-10T23:24:39+09:00 Subject: Re: sending a file via http Ok, I removed the content-type stuff as I'm doing this from the command line for now first... $stdout.binmode f = File.open("data.zip").read print f output: PK?? E�q.��)�$ )�$ This file is just over 31MB, so that's definitely not all of it. My OS is windows if that matters. "Brian Candler" wrote in message news:20030410083103.GA19771@uk.tiscali.com... > On Thu, Apr 10, 2003 at 10:22:13AM +0900, Andrew wrote: > > I'm not getting any errors. The problem is that the whole file isn't being > > read. It reads some and outputs what it reads, but it's far from reading > > everything. I have a 30MB file and it's only reading a handful of bytes and > > then stops (no errors). I want it to read the whole file, not part of it. > > Please describe how you know that it is outputting only a few bytes of your > file. > > Can you try the following four-liner: > > #!/usr/local/bin/ruby > $stdout.binmode > print "Content-Type: application/octet-stream\r\n\r\n" > f = File.open("/path/to/album.zip").read > print f > > and if that doesn't work then we can try to narrow it down from there. > > Cheers, > > Brian. >