[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 1:22:13
[Download RAW message or body]
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.
This is a binary file that I'm attempting to read, not text, so would that
cause any problems?
Andrew
"Brian Candler" <B.Candler@pobox.com> wrote in message
news:20030409093428.A30588@linnet.org...
> On Wed, Apr 09, 2003 at 08:37:02AM +0900, Andrew wrote:
> > Yes, this is using CGI. Your code seems to do almost what I want, but
it
> > reads a few (10-20?) bytes and then stops. Is there something in the
zip
> > file that 'read' would interpret as an end of file maybe and cause it to
> > stop?
>
> Oops, my fault:
>
> irb> a = File.read("/etc/passwd")
> NameError: undefined method `read' for File:Class
>
> Try:
>
> File.open("album.zip").read
>
> If your CGI generates errors like that, you should see them in your
> webserver's error log (e.g. /var/log/apache/logs/error_log or something
like
> that)
>
> Cheers,
>
> Brian.
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic