[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: sending a file via http
From:       "Andrew" <nospam123 () anon ! com>
Date:       2003-04-10 14:24:39
[Download RAW message or body]

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" <B.Candler@pobox.com> 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.
>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic