Forum: Ruby on Rails Chopped files when downloading from database

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
marcus (Guest)
on 2006-01-09 21:14
(Received via mailing list)
I have some files stored in db. When I try to download these I only get
65535 bytes from the database even if the file is a lot bigger. Is it a
Rails setting I've missed or a database setting? Anything else?

Using Rails 1.0, WinXP and MySQL4.1

Kyle M. (Guest)
on 2006-01-09 21:38
(Received via mailing list)
On 1/9/06, marcus <removed_email_address@domain.invalid> wrote:
> removed_email_address@domain.invalid

You are probably storing in a database column that's smaller than the
file.  I think the TEXT column in mysql is that long.  Try switching
to LONGTEXT.  Alternately, you could just use file_column.

Kyle M.
Chief Technologist
E Factor Media // FN Interactive
marcus (Guest)
on 2006-01-09 21:53
(Received via mailing list)
Sorry for not specifying the column type. It's actually a blob. Is that
also defaulted to 64k? And we don't want to use file_column since we
want to store in database and not on the file system. If I'm wrong about
this (whether it only stores to file system or not) then I'd be glad to
hear about it.

marcus (Guest)
on 2006-01-09 22:21
(Received via mailing list)
Found the answer myself. A blob is 16-bit big. I'll change it to
longblob instead (32bit)

Thanks for the pointer though.

This topic is locked and can not be replied to.