How can I upload an attachment and store it into a database as a binary blob object? Also if I (file) upload an image and I resize and create thumbnails, how do I save these images into a database. -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rajinder Yadav wrote in post #966402:> How can I upload an attachment and store it into a database as a binary > blob object? > > Also if I (file) upload an image and I resize and create thumbnails, how > do I save these images into a database. > > -- > Kind Regards, > Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely > > GNU/Linux: 2.6.35-22-generic > Kubuntu x86_64 10.10 | KDE 4.5.1 > Ruby 1.9.2p0 | Rails 3.0.1Hello Rajinder, We have a plugin in rails which does exactly this job, it creates thumbnails too. I have implemented this in my two projects. Please follow this steps http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Dec 6, 2010 at 3:22 AM, Atheeq P. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Rajinder Yadav wrote in post #966402: >> How can I upload an attachment and store it into a database as a binary >> blob object? >> >> Also if I (file) upload an image and I resize and create thumbnails, how >> do I save these images into a database. >> >> -- >> Kind Regards, >> Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely >> >> GNU/Linux: 2.6.35-22-generic >> Kubuntu x86_64 10.10 | KDE 4.5.1 >> Ruby 1.9.2p0 | Rails 3.0.1 > > > Hello Rajinder, > > We have a plugin in rails which does exactly this job, it creates > thumbnails too. I have implemented this in my two projects. Please > follow this steps > > http://jimneath.org/2008/04/17/paperclip-attaching-files-in-rails/ >Hi Atheeq, I fiddled with paperclip in the past, but from what I can see the image uploaded are being save to file, not the database. -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Rajinder Yadav wrote in post #966402:> How can I upload an attachment and store it into a database as a binary > blob object?[...] Don''t. Keep binary data in the filesystem. That way you won''t have to invoke Rails every time you want to serve a file, and your database will be easier to maintain. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Dec 6, 2010 at 2:59 PM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Rajinder Yadav wrote in post #966402: >> How can I upload an attachment and store it into a database as a binary >> blob object? > [...] > > Don''t. Keep binary data in the filesystem. That way you won''t have to > invoke Rails every time you want to serve a file, and your database will > be easier to maintain. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgMarnen, you got a valid point, that didn''t cross my mind. Thanks! -- Kind Regards, Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely GNU/Linux: 2.6.35-22-generic Kubuntu x86_64 10.10 | KDE 4.5.1 Ruby 1.9.2p0 | Rails 3.0.1 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.