Forum: Ruby on Rails Chopped files when downloading from database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3a6666f57152610f172a77c8fe6a7420?d=identicon&s=25 marcus (Guest)
on 2006-01-09 20: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

/Marcus
4bd34a2216dc8bdbf1f017f64e4d59e8?d=identicon&s=25 Kyle Maxwell (Guest)
on 2006-01-09 20:38
(Received via mailing list)
On 1/9/06, marcus <m-lists@bristav.se> wrote:
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

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 Maxwell
Chief Technologist
E Factor Media // FN Interactive
kyle@efactormedia.com
1-866-263-3261
3a6666f57152610f172a77c8fe6a7420?d=identicon&s=25 marcus (Guest)
on 2006-01-09 20: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
3a6666f57152610f172a77c8fe6a7420?d=identicon&s=25 marcus (Guest)
on 2006-01-09 21: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.

/Marcus
This topic is locked and can not be replied to.