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
On 1/9/06, marcus <m-lists@bristav.se> wrote:> 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 > > _______________________________________________ > Rails mailing list > 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
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 Kyle Maxwell wrote:> On 1/9/06, marcus <m-lists@bristav.se> wrote: > >>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 >> >>_______________________________________________ >>Rails mailing list >>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 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Found the answer myself. A blob is 16-bit big. I''ll change it to longblob instead (32bit) Thanks for the pointer though. /Marcus marcus wrote:> 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 > > Kyle Maxwell wrote: > >> On 1/9/06, marcus <m-lists@bristav.se> wrote: >> >>> 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 >>> >>> _______________________________________________ >>> Rails mailing list >>> 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 >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >